diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2018-10-02 13:29:35 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2018-10-02 13:29:35 +0530 |
commit | d0cbf587020f78e26f03246939e4fb5c83c776fe (patch) | |
tree | a1093aa73bb8bbfee0f37ce142c41738219bdfd1 | |
parent | 60a98f5180835b764a9da98ef7cbcca16710855f (diff) |
Set bc scale=10, add test
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | bcal.1 | 2 | ||||
-rw-r--r-- | src/bcal.c | 2 | ||||
-rwxr-xr-x | test.py | 2 |
4 files changed, 5 insertions, 3 deletions
@@ -169,7 +169,7 @@ optional arguments: - sector size: 0x200 (512) - max heads per cylinder: 0x10 (16) - max sectors per track: 0x3f (63) -- **bc variables**: scale = 5, ibase = 10. `bc` is not called in minimal output mode. +- **bc variables**: scale = 10, ibase = 10. `bc` is not called in minimal output mode. ### Examples @@ -60,7 +60,7 @@ Refer to: - max sectors per track: 0x3f (63) .PP .IP 10. 4 -\fBbc variables\fR: scale = 5, ibase = 10. \fIbc\fR is not called in minimal output mode. +\fBbc variables\fR: scale = 10, ibase = 10. \fIbc\fR is not called in minimal output mode. .SH OPTIONS .TP .BI "-c=" N @@ -208,7 +208,7 @@ static int try_bc(char *expr) /* parent */ char buffer[128] = ""; - ret = write(pipe_pc[1], "scale=5\n", 8); + ret = write(pipe_pc[1], "scale=10\n", 9); ret = write(pipe_pc[1], "last=", 5); if (lastres.p[0]) @@ -86,6 +86,7 @@ test = [ ('./bcal', '-m', "2 >>> 2"), # 61 ('./bcal', '-m', "2 b<3"), # 62 ('./bcal', '-m', "(2giB * 2) / (2kib >> 2)"), # 63 + ('./bcal', '-b', "9876543210.987654321 * 123456789.123456789"), # 64 ] res = [ @@ -154,6 +155,7 @@ res = [ b'ERROR: invalid sequence >>>\n', # 61 b'ERROR: invalid operator <\n', # 62 b'8388608\n', # 63 + b'1219326312467611632.3609205901\n', # 64 ] |