diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2021-08-19 08:21:35 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2021-08-19 08:21:35 +0530 |
commit | 21320b2fe9ba29237d81d0bd8abab6d070174aa7 (patch) | |
tree | 7647f256ed3f9479f727f910eca39ff932fd2a27 | |
parent | ab752bfe837eb86c079fd9062e665d54440938f5 (diff) |
Update docs
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | bcal.1 | 15 | ||||
-rw-r--r-- | src/bcal.c | 2 |
3 files changed, 17 insertions, 11 deletions
@@ -17,7 +17,7 @@ It has a [`bc`](https://www.gnu.org/software/bc/manual/html_mono/bc.html) mode for general-purpose numerical calculations. Alternatively, it can also invoke [`calc`](http://www.isthe.com/chongo/tech/comp/calc/) which works better with expressions involving multiple bases. -`bcal` follows Ubuntu's standard unit conversion and notation [policy](https://wiki.ubuntu.com/UnitsPolicy). Only 64-bit operating systems are supported. +`bcal` uses [SI and IEC binary prefixes](https://en.wikipedia.org/wiki/Binary_prefix) and supports 64-bit Operating Systems only. <p align="center"> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://img.shields.io/badge/donate-@PayPal-1eb0fc.svg" alt="Donate via PayPal!" /></a> @@ -118,7 +118,7 @@ Storage expression calculator. positional arguments: expr expression in decimal/hex operands N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB - see https://wiki.ubuntu.com/UnitsPolicy + https://en.wikipedia.org/wiki/Binary_prefix default unit is B (byte), case is ignored N can be decimal or '0x' prefixed hex value @@ -144,7 +144,7 @@ prompt keys: - **Interactive mode**: `bcal` enters the REPL mode if no arguments are provided. Storage unit conversion, base conversion and expression evaluation are supported in this mode. The last valid result is stored in the variable **r**. - **Expression**: Expression passed as argument in one-shot mode must be within double quotes. Inner spaces are ignored. Supported operators: `+`, `-`, `*`, `/`, `%` and C bitwise operators (except `~` due to storage width dependency). -- **N [unit]**: `N` can be a decimal or '0x' prefixed hex value. `unit` can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB following Ubuntu policy. Default is byte. As all of these tokens are unique, `unit` is case-insensitive. +- **N [unit]**: `N` can be a decimal or '0x' prefixed hex value. `unit` can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB. Default is Byte. As all of these tokens are unique, `unit` is case-insensitive. - **Numeric representation**: Decimal and hex are recognized in expressions and unit conversions. Binary is also recognized in other operations. - **Syntax**: Prefix hex inputs with `0x`, binary inputs with `0b`. - **Precision**: 128 bits if `__uint128_t` is available or 64 bits for numerical conversions. Floating point operations use `long double`. Negative values in storage expressions are unsupported. Only 64-bit operating systems are supported. @@ -215,10 +215,9 @@ prompt keys: 15 gib + 15 kib r / 5 $ bcal -m < expr -10. Help and additional information. +10. Use as a general-purpose calculator. - $ man bcal - $ bcal -h + $ bcal -b ### Testing @@ -13,9 +13,8 @@ It invokes GNU \fBbc\fR for non-storage expressions. Alternatively, it can also .B export BCAL_USE_CALC=1 .EE .PP -\fBbcal\fR follows Ubuntu's standard unit conversion and notation policy: -.br -.I https://wiki.ubuntu.com/UnitsPolicy +\fBbcal\fR uses [SI and IEC binary prefixes]: +.I https://en.wikipedia.org/wiki/Binary_prefix .PP .SH FEATURES .PP @@ -39,7 +38,7 @@ It invokes GNU \fBbc\fR for non-storage expressions. Alternatively, it can also \fBExpression\fR: Expression passed as argument in one-shot mode must be within double quotes. Inner spaces are ignored. Supported operators: +, -, *, /, % and C bitwise operators (except ~ due to storage width dependency). .PP .IP 3. 4 -\fBN [unit]\fR: \fIN\fR can be a decimal or '0x' prefixed hex value. \fIunit\fR can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB following Ubuntu policy. Default is byte. As all of these tokens are unique, \fIunit\fR is case-insensitive. +\fBN [unit]\fR: \fIN\fR can be a decimal or '0x' prefixed hex value. \fIunit\fR can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB. Default is Byte. As all of these tokens are unique, \fIunit\fR is case-insensitive. .PP .IP 4. 4 \fBNumeric representation\fR: Decimal and hex are recognized in expressions and unit conversions. Binary is also recognized in other operations. @@ -205,6 +204,14 @@ Redirect from file. .B r / 5 .B $ bcal -m < expr .EE +.PP +.IP 10. 4 +Use as a general-purpose calculator. +.PP +.EX +.IP +.B $ bcal -b +.EE .SH AUTHORS Arun Prakash Jana <engineerarun@gmail.com> .SH HOME @@ -1179,7 +1179,7 @@ Storage expression calculator.\n\n\ positional arguments:\n\ expr expression in decimal/hex operands\n\ N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB\n\ - see https://wiki.ubuntu.com/UnitsPolicy\n\ + https://en.wikipedia.org/wiki/Binary_prefix\n\ default unit is B (byte), case is ignored\n\ N can be decimal or '0x' prefixed hex value\n\n\ optional arguments:\n\ |