Skip to content

Releases: gavinhoward/bc

Release 5.0.0

09 Aug 04:15
Compare
Choose a tag to compare

This is a major production release with several changes:

  • Added support for OpenBSD's pledge() and unveil().
  • Fixed print bug where a backslash newline combo was printed even if only one digit was left, something I blindly copied from GNU bc, like a fool.
  • Fixed bugs in the manuals.
  • Fixed a possible multiplication overflow in power.
  • Temporary numbers are garbage collected if allocation fails, and the allocation is retried. This is to make bc and dc more resilient to running out of memory.
  • Limited the number of temporary numbers and made the space for them static so that allocating more space for them cannot fail.
  • Allowed integers with non-zero scale to be used with power, places, and shift operators.
  • Added greatest common divisor and least common multiple to lib2.bc.
  • Added SIGQUIT handling to history.
  • Added a command to dc (y) to get the length of register stacks.
  • Fixed multi-digit bugs in lib2.bc.
  • Removed the no prompt build option.
  • Created settings that builders can set defaults for and users can set their preferences for. This includes the bc banner, resetting on SIGINT, TTY mode, and prompt.
  • Added history support to Windows.
  • Fixed bugs with the handling of register names in dc.
  • Fixed bugs with multi-line comments and strings in both calculators.
  • Added a new error type and message for dc when register stacks don't have enough items.
  • Optimized string allocation.
  • Made bc and dc UTF-8 capable.
  • Fixed a bug with void functions.
  • Fixed a misspelled symbol in bcl. This is technically a breaking change, which requires this to be 5.0.0.
  • Added the ability for users to get the copyright banner back.
  • Added the ability for users to have bc and dc quit on SIGINT.
  • Added the ability for users to disable prompt and TTY mode by environment variables.
  • Added the ability for users to redefine keywords. This is another reason this is 5.0.0.
  • Added dc's modular exponentiation and divmod to bc.
  • Added the ability to assign strings to variables and array elements and pass them to functions in bc.
  • Added dc's asciify command and stream printing to bc.
  • Added a command to dc (Y) to get the length of an array.
  • Added a command to dc (,) to get the depth of the execution stack.
  • Added bitwise and, or, xor, left shift, right shift, reverse, left rotate, right rotate, and mod functions to lib2.bc.
  • Added the functions s2u(x) and s2un(x,n), to lib2.bc.
$ sha512sum bc-5.0.0.tar.xz
3ac4639922398e633aae3c3679ee3e53f3688da3992c55c120165b5718860f9857b7f46c43a9e18da0dd67ac92c8855f7449dfdfdfd11c419dc4ab6683550740  bc-5.0.0.tar.xz

$ sha256sum bc-5.0.0.tar.xz
595e803214708d94860d93b53ec7b84eb7bdb0c5c38fa96f5434009f868fe038  bc-5.0.0.tar.xz

$ stat -c '%s  %n'
429376  bc-5.0.0.tar.xz

$ sha512sum bc-5.0.0.tar.xz.sig
256c04a059efb6bf41a1066ec588de852043ee50e08077f73e2a9f5a9f8369cd87470372acdcb6d8cfee4f5e07c9159145338595b0eee568ba11b2bbf1ce49ec  bc-5.0.0.tar.xz.sig

$ sha256sum bc-5.0.0.tar.xz.sig
dd23aa9931646b360a171187b4bc33dce3faf50395cc4ab7a4c3dffdd096af02  bc-5.0.0.tar.xz.sig

$ stat -c '%s  %n'
662  bc-5.0.0.tar.xz.sig

$ sha512sum Win32_Debug.zip
c48a88c964cccd8e9a6f4e7c3a4b390e364a18bb00ae68c750adbc7462baad1b75125da4418f0ff0a6901eadd39d6c21deb626319e5d71ea21f1a09833bd1a4d  Win32_Debug.zip

$ sha256sum Win32_Debug.zip
b8819f70e1fadecf3316949798ea8373b42c78e0f4651f54a93f65abc00d1737  Win32_Debug.zip

$ stat -c '%s  %n'
340347  Win32_Debug.zip

$ sha512sum Win32_Debug.zip.sig
aeae6de48bd82443e7c0511e75029127a1d11f51f029018b71ad57e74ddc546905a8be3d31b9ca267aa4d9d1109b5539f9244ce5b0d45e72f6da6c411fa31713  Win32_Debug.zip.sig

$ sha256sum Win32_Debug.zip.sig
3e07bd2b6305e62d49a03c90661f7c47e5187a4b51e51272a6946ef93c73984f  Win32_Debug.zip.sig

$ stat -c '%s  %n'
662  Win32_Debug.zip.sig

$ sha512sum Win32_Release.zip
927d48111ae17da782df4e900ada9f5fa97e6dc91dd9c46cac1f8c45d8abe95e893127851a2ce27968e8c489a81a164b2018c23d2bd06b7e73694519de029654  Win32_Release.zip

$ sha256sum Win32_Release.zip
571c0c3bb471ea9e8ba720f93444135133b7b7f18e2d5513cbcfa377cb835f50  Win32_Release.zip

$ stat -c '%s  %n'
347946  Win32_Release.zip

$ sha512sum Win32_Release.zip.sig
f85593c4f06df4dd05dd3afdb961935dba6f4b6f4f188f6f7d38788bff673520207efc7ef7e799c20d4155e7e413287782f2562c964b96468c460017bc399e46  Win32_Release.zip.sig

$ sha256sum Win32_Release.zip.sig
1bd4dc7f66529cc63909816a38a78ee3a182d6d8a7254201be744e47ab64aa6a  Win32_Release.zip.sig

$ stat -c '%s  %n'
662  Win32_Release.zip.sig

$ sha512sum Win64_Debug.zip
5ddff5339b65834ba805ce210012412f1bf59499b1d605bdc62675f7ab67a9d074846aeb8e0130581204245674bfa666d73af0956480ead26909a4d1dc16d387  Win64_Debug.zip

$ sha256sum Win64_Debug.zip
c6c94daee6dc5dadfb6f4012985e1f533b53912947d9a5c4b41c93ed7b387127  Win64_Debug.zip

$ stat -c '%s  %n'
396711  Win64_Debug.zip

$ sha512sum Win64_Debug.zip.sig
2cf9843d48155bd5ddd68f6f020f624e660366dd810e0315377d0fe1eab5ba9e14d172c250fdc782f6b81c59931b4cc7b2e9dcbc064aa54758be47c3a5a44dda  Win64_Debug.zip.sig

$ sha256sum Win64_Debug.zip.sig
5162ad874ecc4a30f7b9d819cce715ad541756defc5e5668cc0107b0014b3db8  Win64_Debug.zip.sig

$ stat -c '%s  %n'
662  Win64_Debug.zip.sig

$ sha512sum Win64_Release.zip
8df13d4d99829b0746b6c3c7b20447c5927a24bcc467b7b89d76fe8eb3eb9e43acee6a03543f9452733e6d43f6e3fdb0bbdfa25bc121568f8926d1799051777d  Win64_Release.zip

$ sha256sum Win64_Release.zip
ca983b8f8673f86890d26d674b69888c269fffc051ef7ba774718559e05c89a5  Win64_Release.zip

$ stat -c '%s  %n'
400591  Win64_Release.zip

$ sha512sum Win64_Release.zip.sig
86427373bb7a9b458be09ee7e34efe8efd657f03b0a936fdec4adfced9d746d660f23fc053eab43f9862c9b3299728fe70802de1e9e416020ad8d62584c06c74  Win64_Release.zip.sig

$ sha256sum Win64_Release.zip.sig
685caf14a04d078516db3de684d4a65d5a8cd4762307413ee7b26e1d5d2ac1bf  Win64_Release.zip.sig

$ stat -c '%s  %n'
662  Win64_Release.zip.sig

Release 4.0.2

12 May 04:20
Compare
Choose a tag to compare

This is a production release that fixes two bugs:

  1. If no files are used and the first statement on stdin is invalid, scale would not be set to 20 even if -l was used.
  2. When using history, bc failed to respond properly to SIGSTOP and SIGTSTP.
$ sha512sum bc-4.0.2.tar.xz
f3564cb953bca2003c9fd565b3114a2701de4437c6db3cace29edab186d3270cd98f66f3eb1a45fd074a44736fef39f78675959f400c1c23a4a2e930d469c059  bc-4.0.2.tar.xz

$ sha256sum bc-4.0.2.tar.xz
b4a7046325557a44d02165874f957c3abf49e2ba4491c8275326cb7c55ef2290  bc-4.0.2.tar.xz

$ stat -c '%s  %n'
235464  bc-4.0.2.tar.xz

$ sha512sum bc-4.0.2.tar.xz.sig
3cb05a0d3561acab6fbd6e473c2d8eb32daf825c9aa4840bfb9f2d850e5525661574644d01a4411ff2df099499d226d81bf1b226e975b07f059f2f3c38372a91  bc-4.0.2.tar.xz.sig

$ sha256sum bc-4.0.2.tar.xz.sig
1b8f8eeff862ddd4c8ed6f40a16f2608a029b86e5cb37a70ce6cf5730d8230a6  bc-4.0.2.tar.xz.sig

$ stat -c '%s  %n'
662  bc-4.0.2.tar.xz.sig

Release 4.0.1

21 Apr 03:03
Compare
Choose a tag to compare

This is a production release that only adds one thing: flushing output when it is printed with a print statement.

$ sha512sum bc-4.0.1.tar.xz
c12523ebca7a2419754b65e010d2c0bae15117ed06aa876d01cadc1b45334d4ea774cbb3e94ccf445d1175fe8d500b1d0b53576009b8ed676b6ac6493db98eba  bc-4.0.1.tar.xz

$ sha256sum bc-4.0.1.tar.xz
cbb20ac36e5250d65db78ff46acd85e4804b603145bb4479d80348552216de19  bc-4.0.1.tar.xz

$ stat -c '%s  %n'
235320  bc-4.0.1.tar.xz

$ sha512sum bc-4.0.1.tar.xz.sig
b124ad5795e96bf17146c0f9ba3e3b708b0bf2bc1f8a11fcb500f00cff8a6b3202a925aa0c195320e5dc47ded4f1196dac7e0a2818e7779cc473fef879100e4b  bc-4.0.1.tar.xz.sig

$ sha256sum bc-4.0.1.tar.xz.sig
6441addcadd1f87ba9e5689a7589486757b698baf3e1923b2b9063658f49f0d0  bc-4.0.1.tar.xz.sig

$ stat -c '%s  %n'
662  bc-4.0.1.tar.xz.sig

Release 4.0.0

05 Apr 17:17
Compare
Choose a tag to compare

This is a production release with many fixes, a new command-line option, and a big surprise:

  • A bug was fixed in dc's P command where the item on the stack was not popped.
  • Various bugs in the manuals have been fixed.
  • A known bug was fixed where history did not interact well with prompts printed by user code without newlines.
  • A new command-line option, -R and --no-read-prompt was added to disable just the prompt when using read() (bc) or ? (dc).
  • And finally, official support for Windows was added.

The last item is why this is a major version bump.

Currently, only one set of build options (extra math and prompt enabled, history and NLS/locale support disabled, both calculators enabled) is supported on Windows. However, both debug and release builds are supported.

In addition, Windows builds are supported for the the library (bcl).

For more details about how to build on Windows, see the README or the build manual.

$ sha512sum bc-4.0.0.tar.xz
e25f4377df81c14f7036fdcbcd503a10ebb4e2663b182da78928aad871b22940c503d54f9a7942798d4e1f38e0487047f492348041a229f18e0fd0e45aab33b3  bc-4.0.0.tar.xz

$ sha256sum bc-4.0.0.tar.xz
d3c3ea6c3a439d20eb57e4b84b10f16a41af1b069640a591f584d704054f0a48  bc-4.0.0.tar.xz

$ stat -c '%s  %n'
235496  bc-4.0.0.tar.xz

$ sha512sum bc-4.0.0.tar.xz.sig
cc511655b2cc68d6b4e5bd1e4228abf9a4ff12d96a7f28dab3f418163e9013063acdc052906c94ce285ed94be7e0c8b957988b1842170adae3c7511f2a451bb9  bc-4.0.0.tar.xz.sig

$ sha256sum bc-4.0.0.tar.xz.sig
568c27c9bd7b0ac44244aadce2f76760fd5d5dc4f605cdb12a1568b826344be7  bc-4.0.0.tar.xz.sig

$ stat -c '%s  %n'
662  bc-4.0.0.tar.xz.sig

Release 3.3.4

19 Mar 03:02
Compare
Choose a tag to compare

This is a production release that fixes a small bug.

The bug was that output was not flushed before a read() call, so prompts without a newline on the end were not flushed before the read() call.

This is such a tiny bug that users only need to upgrade if they are affected.

$ sha512sum bc-3.3.4.tar.xz
212b36a3fafbda28c6416d29e2d9e49272c42d95dcdc3bbbb3691e4686ca3f0a9fec883a099d059c5bd21a9b08bf5b2eff01169de20df9777c2fce66a8cda783  bc-3.3.4.tar.xz

$ sha256sum bc-3.3.4.tar.xz
268dad63e5df73520ff03e54d445bcf4d5c46c4f77a01c3009df57b3e5bb4fa4  bc-3.3.4.tar.xz

$ stat -c '%s  %n'
230264  bc-3.3.4.tar.xz

$ sha512sum bc-3.3.4.tar.xz.sig
40425b7ead268b118c5ce85333c093696b843dce171bb98cef267044aae9d565d2a66cff91f66d10e4ead9b92482316e1bbac5824fe7c4a0ed7d877c07cc00ec  bc-3.3.4.tar.xz.sig

$ sha256sum bc-3.3.4.tar.xz.sig
29d06c17f6d403d074ae5a658f11dbade8a05653ea876b9f617fde17393d652c  bc-3.3.4.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.3.4.tar.xz.sig

Release 3.3.3

04 Mar 23:52
Compare
Choose a tag to compare

This is a production release with one tweak and fixes for manuals.

The tweak is that length(0) returns 1 instead of 0. In 3.3.1, I changed it so length(0.x), where x could be any number of digits, returned the scale, but length(0) still returned 0 because I believe that 0 has 0 significant digits.

After request of FreeBSD and considering the arguments of a mathematician, compatibility with other bc's, and the expectations of users, I decided to make the change.

The fixes for manuals fixed a bug where -- was rendered as -.

$ sha512sum bc-3.3.3.tar.xz
dfdd8023453406d9f681e04da7acaad4459e632fded0f2edb2b51607438a27074935af6db4b3580120daf56e6b52283275d0c2c809380caa164957f1901e9dde  bc-3.3.3.tar.xz

$ sha256sum bc-3.3.3.tar.xz
b9fde063b32d4f0c3bab9d069aa8ac4d7d804ce5bebb54d7a2e574e70309bc93  bc-3.3.3.tar.xz

$ stat -c '%s  %n'
229688  bc-3.3.3.tar.xz

$ sha512sum bc-3.3.3.tar.xz.sig
aeb0ac35e5b99f101fcf04e57659712a378c22da138ff405866baf4c41963af111b2128fc23aeb672ef0a928948ec9f4eeb9eea51781cb20a24cba7fd92af09a  bc-3.3.3.tar.xz.sig

$ sha256sum bc-3.3.3.tar.xz.sig
0fe5f256396f0e81d686a728ccf106094f577669877d05e1d82161f5de1d0ede  bc-3.3.3.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.3.3.tar.xz.sig

Release 3.3.2

03 Mar 16:16
Compare
Choose a tag to compare

This is a production release that fixes a divide-by-zero bug in root() in the extended math library. All previous versions with root() have the bug.

$ sha512sum bc-3.3.2.tar.xz
ae3e99c49137e1335c6c6c0f5a39a5488d174b98bdf85ce1c9311546ea093cd6ed2d8d0a3e6d401cdf093d509717ae01ec71e6e60d580e71101c673da5efc953  bc-3.3.2.tar.xz

$ sha256sum bc-3.3.2.tar.xz
d2f39937b1b20375e3cfd675562cd2e061408772298e7bb53668f725b94de8ed  bc-3.3.2.tar.xz

$ stat -c '%s  %n'
228892  bc-3.3.2.tar.xz

$ sha512sum bc-3.3.2.tar.xz.sig
5f3392a986e713f0714905e664c89251a8383751c9a52b37686f1063798cba495e61aa5e93069de5b07f0b156bbeebd32c2fb85f43f70b69ae41d1fd43ae9277  bc-3.3.2.tar.xz.sig

$ sha256sum bc-3.3.2.tar.xz.sig
ca68c4101cb56f6a90915ac28cc75da28853099063ce292b4e9602a6685bfb3e  bc-3.3.2.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.3.2.tar.xz.sig

Release 3.3.1

26 Feb 21:21
Compare
Choose a tag to compare

This is a production release that fixes a bug.

The bug was in the reporting of number length when the value was 0.

$ sha512sum bc-3.3.1.tar.xz
098bcbe0abc323b295bd46bcf8af00e69898ef560108b660964fb2dfdf6d114a17f051dde0fff06f06aa97f4cee086275eb5dc937166034d795d5cb3da999fca  bc-3.3.1.tar.xz

$ sha256sum bc-3.3.1.tar.xz
b6328ad691c71d1ae910dc3d45fe4b35faddd15f79b07b482e21b1766c89dda4  bc-3.3.1.tar.xz

$ stat -c '%s  %n'
229708  bc-3.3.1.tar.xz

$ sha512sum bc-3.3.1.tar.xz.sig
904a47bc565218d8243920f5c3c6b8a45a9f9914766fbba63730f926e7a08c3fbc28c2adcc23a3e08a4b1939375a5d766270415675afb7f9fe7b245ae498be1c  bc-3.3.1.tar.xz.sig

$ sha256sum bc-3.3.1.tar.xz.sig
585bf520d50bd6094573aef5ba223c642f5a77e8e643e9c015ca2b111e01d4e4  bc-3.3.1.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.3.1.tar.xz.sig

Release 3.3.0

17 Feb 05:35
Compare
Choose a tag to compare

This is a production release that changes one behavior and fixes documentation bugs.

The changed behavior is the treatment of -e and -f when given through BC_ENV_ARGS or DC_ENV_ARGS. Now bc and dc do not exit when those options (or their equivalents) are given through those environment variables. However, bc and dc still exit when they or their equivalents are given on the command-line.

$ sha512sum bc-3.3.0.tar.xz
b8d0b6d6d9c5d4fc62df62d1b9b7e7006a8b430e063fe0d5f646cfaeb4c6fc9c7037b644e853b7ae7d5c5f42f079221e9cdc32564d70c9ddd6bb867ddc7056de  bc-3.3.0.tar.xz

$ sha256sum bc-3.3.0.tar.xz
d4c0da5a6be9652f55bf237dd44d68602f75c617b486356cb70fc4514f2fd360  bc-3.3.0.tar.xz

$ stat -c '%s  %n'
229580  bc-3.3.0.tar.xz

$ sha512sum bc-3.3.0.tar.xz.sig
935b381ce5a84a895fabcdfe87fbcb9c5c2f2af2a6ea12948a704447406932366261a105ce08b95dd9e4257b0f46ab98b6df4de61186c82b602dd81b334a0d4b  bc-3.3.0.tar.xz.sig

$ sha256sum bc-3.3.0.tar.xz.sig
14be11a9d60b06aed93f2a4cece039d78e49eb3aa4a7b92f9058b9e6e53afb8d  bc-3.3.0.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.3.0.tar.xz.sig

Release 3.2.7

14 Feb 02:25
Compare
Choose a tag to compare

This is a production release that removes a small non-portable shell operation in configure.sh. This problem was only noticed on OpenBSD, not FreeBSD or Linux.

Non-OpenBSD users do NOT need to upgrade, although NetBSD users may also need to upgrade.

$ sha512sum bc-3.2.7.tar.xz
b516c400625b54b68ed5c1d484d48d80a094495c1d96437129a835dcc5caf2c29d5524d4b67144d11215569bd6ec1ac90113b3fda0d621c8672313119da4f9fa  bc-3.2.7.tar.xz

$ sha256sum bc-3.2.7.tar.xz
ab3d925d14687e38d971b3f2ea9dff1f3338d0d151644f7fa503dbefe3d8f573  bc-3.2.7.tar.xz

$ stat -c '%s  %n'
228540  bc-3.2.7.tar.xz

$ sha512sum bc-3.2.7.tar.xz.sig
8ab7a3595e130e036acac8554a5107a11b5212d93d298e8a0370a402049026c702c6f6f06fcf6f46a7e36eb6b5a7d1b6b42f5987ea39995039e512226b6c6c26  bc-3.2.7.tar.xz.sig

$ sha256sum bc-3.2.7.tar.xz.sig
55851847a6ec3c20d1cae884f67c7adff712b45a2c1575420645b1228076d9a9  bc-3.2.7.tar.xz.sig

$ stat -c '%s  %n'
662  bc-3.2.7.tar.xz.sig