1252884aeSStefan Eßer# News 2252884aeSStefan Eßer 3*9b04aee8SStefan Eßer## 7.0.2 4*9b04aee8SStefan Eßer 5*9b04aee8SStefan EßerThis is a production release that fixes `Ctrl+d` on FreeBSD and Linux when using 6*9b04aee8SStefan Eßer`editline`. 7*9b04aee8SStefan Eßer 8*9b04aee8SStefan EßerThis bug was caused by the macOS fix in `7.0.0`. Unfortunately, this means that 9*9b04aee8SStefan EßermacOS does not respond properly to `Ctrl+d`. 10*9b04aee8SStefan Eßer 115b0dc991SStefan Eßer## 7.0.1 125b0dc991SStefan Eßer 135b0dc991SStefan EßerThis is a production release that fixes a warning using GCC on FreeBSD. 145b0dc991SStefan Eßer 155b0dc991SStefan EßerOther users do ***NOT*** need to upgrade. 165b0dc991SStefan Eßer 1712e0d316SStefan Eßer## 7.0.0 1812e0d316SStefan Eßer 1912e0d316SStefan EßerThis is a production release to fix three bugs. 2012e0d316SStefan Eßer 2112e0d316SStefan EßerThe first bug is that `bc`/`dc` will exit on macOS when the terminal is resized. 2212e0d316SStefan Eßer 2312e0d316SStefan EßerThe second bug is that an array, which should only be a function parameter, was 2412e0d316SStefan Eßeraccepted as part of larger expressions. 2512e0d316SStefan Eßer 2612e0d316SStefan EßerThe third bug is that value stack for `dc` was cleared on any error. However, 2712e0d316SStefan Eßerthis is not how other `dc` behave. To bring `dc` more in line with other 2812e0d316SStefan Eßerimplementations, this behavior was changed. This change is why this version is a 2912e0d316SStefan Eßernew major version. 3012e0d316SStefan Eßer 31a970610aSStefan Eßer## 6.7.6 32a970610aSStefan Eßer 33a970610aSStefan EßerThis is a production release to fix one bug. 34a970610aSStefan Eßer 35a970610aSStefan EßerThe bug was that `bc` attempted to jump out when flushing `stdout` on exit, but 36a970610aSStefan Eßerthere is no jump buf at that point. 37a970610aSStefan Eßer 38f4fbc49dSStefan Eßer## 6.7.5 39f4fbc49dSStefan Eßer 40f4fbc49dSStefan EßerThis is a production release to fix one small bug. 41f4fbc49dSStefan Eßer 42f4fbc49dSStefan EßerThe bug is that sometimes numbers are printed to incorrect line lengths. The 43f4fbc49dSStefan Eßernumber is always correct; the line is just longer than the limit. 44f4fbc49dSStefan Eßer 45f4fbc49dSStefan EßerUsers who do not care do not need to update. 46f4fbc49dSStefan Eßer 47e6857bd4SStefan Eßer## 6.7.4 48e6857bd4SStefan Eßer 49e6857bd4SStefan EßerThis is a production release to fix problems in the `bc` manual. 50e6857bd4SStefan Eßer 51e6857bd4SStefan EßerUsers only need to update if desired. 52e6857bd4SStefan Eßer 53e6857bd4SStefan Eßer## 6.7.3 54e6857bd4SStefan Eßer 55e6857bd4SStefan EßerThis is a production release to fix the library build on Mac OSX. 56e6857bd4SStefan Eßer 57e6857bd4SStefan EßerUsers on other platforms do *not* need to update. 58e6857bd4SStefan Eßer 59aa339f1dSStefan Eßer## 6.7.2 60aa339f1dSStefan Eßer 61aa339f1dSStefan EßerThis is a production release to remove some debugging code that I accidentally 62aa339f1dSStefan Eßercommitted. 63aa339f1dSStefan Eßer 64aa339f1dSStefan Eßer## 6.7.1 65aa339f1dSStefan Eßer 66aa339f1dSStefan EßerThis is a production release with a bug fix for `SIGINT` only being handled 67aa339f1dSStefan Eßeronce. 68aa339f1dSStefan Eßer 69aa339f1dSStefan Eßer## 6.7.0 70aa339f1dSStefan Eßer 71aa339f1dSStefan EßerThis is a production release with three new functions in the [extended math 72aa339f1dSStefan Eßerlibrary][16]: `min()`, `max()`, and `i2rand()`. 73aa339f1dSStefan Eßer 74aa339f1dSStefan Eßer## 6.6.1 75aa339f1dSStefan Eßer 76aa339f1dSStefan EßerThis is a production release with an improved `p()` function in the [extended 77aa339f1dSStefan Eßermath library][16]. 78aa339f1dSStefan Eßer 79aa339f1dSStefan EßerUsers who don't care do not need to upgrade. 80aa339f1dSStefan Eßer 8176238846SStefan Eßer## 6.6.0 8276238846SStefan Eßer 8376238846SStefan EßerThis is a production release with two bug fixes and one change. 8476238846SStefan Eßer 8576238846SStefan EßerThe first bug fix is to fix the build on Mac OSX. 8676238846SStefan Eßer 8776238846SStefan EßerThe second bug was to remove printing a leading zero in scientific or 8876238846SStefan Eßerengineering output modes. 8976238846SStefan Eßer 9076238846SStefan EßerThe change was that the implementation of `irand()` was improved to call the 9176238846SStefan EßerPRNG less. 9276238846SStefan Eßer 938c48f4c5SStefan Eßer## 6.5.0 948c48f4c5SStefan Eßer 958c48f4c5SStefan EßerThis is a production release that fixes an infinite loop bug in `root()` and 968c48f4c5SStefan Eßer`cbrt()`, fixes a bug with `BC_LINE_LENGTH=0`, and adds the `fib()` function to 978c48f4c5SStefan Eßerthe extended math library to calculate Fibonacci numbers. 988c48f4c5SStefan Eßer 99175a4d10SStefan Eßer## 6.4.0 100175a4d10SStefan Eßer 101175a4d10SStefan EßerThis is a production release that fixes a `read()`/`?` bug and adds features to 102175a4d10SStefan Eßer`bcl`. 103175a4d10SStefan Eßer 104175a4d10SStefan EßerThe bug was that multiple read calls could repeat old data. 105175a4d10SStefan Eßer 106175a4d10SStefan EßerThe new features in `bcl` are functions to preserve `BclNumber` arguments and 107175a4d10SStefan Eßernot free them. 108175a4d10SStefan Eßer 109175a4d10SStefan Eßer***WARNING for `bcl` Users***: The `bcl_rand_seedWithNum()` function used to not 110175a4d10SStefan Eßerconsume its arguments. Now it does. This change could have made this version 111175a4d10SStefan Eßer`7.0.0`, but I'm 99.9% confident that there are no `bcl` users, or if there are, 112175a4d10SStefan Eßerthey probably don't use the PRNG. So I took a risk and didn't update the major 113175a4d10SStefan Eßerversion. 114175a4d10SStefan Eßer 115175a4d10SStefan Eßer`bcl` now includes more capacity to check for invalid numbers when built to run 116175a4d10SStefan Eßerunder Valgrind. 117175a4d10SStefan Eßer 118103d7cdfSStefan Eßer## 6.3.1 119103d7cdfSStefan Eßer 120103d7cdfSStefan EßerThis is a production release that fixes a `bc` dependency loop for minimal 121103d7cdfSStefan Eßerenvironments and Linux from Scratch. 122103d7cdfSStefan Eßer 123103d7cdfSStefan Eßer## 6.3.0 124103d7cdfSStefan Eßer 125103d7cdfSStefan EßerThis is a production release with a couple of fixes for manuals and a new 126103d7cdfSStefan Eßerfeature for `dc`: there is now a command to query whether extended registers are 127103d7cdfSStefan Eßerenabled or not. 128103d7cdfSStefan Eßer 129103d7cdfSStefan EßerUsers who don't care do not need to upgrade. 130103d7cdfSStefan Eßer 131103d7cdfSStefan Eßer## 6.2.6 132103d7cdfSStefan Eßer 133103d7cdfSStefan EßerThis is a production release that fixes an install bug that affected locale 134103d7cdfSStefan Eßerinstallation of all locales when using `mksh`. Users do ***NOT*** need to 135103d7cdfSStefan Eßerupgrade if they don't use `mksh` and/or don't need to install all locales. 136103d7cdfSStefan Eßer 137103d7cdfSStefan Eßer## 6.2.5 138103d7cdfSStefan Eßer 139103d7cdfSStefan EßerThis is a production release that fixes a test bug that affected Android and 140103d7cdfSStefan Eßer`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another 141103d7cdfSStefan Eßeraffected shell and need to run the test suite. 142103d7cdfSStefan Eßer 1434fca8e0fSStefan Eßer## 6.2.4 1444fca8e0fSStefan Eßer 1454fca8e0fSStefan EßerThis is a production release that fixes a test failure that happens when 1464fca8e0fSStefan Eßer`tests/bc/scripts/timeconst.bc` doesn't exist. This should only affect 1474fca8e0fSStefan Eßerpackagers. 1484fca8e0fSStefan Eßer 1494fca8e0fSStefan EßerThis bug happened because I forgot something I added in the previous release: 1504fca8e0fSStefan Eßerbetter error checking in tests to help packagers. Unfortunately, I was too 1514fca8e0fSStefan Eßerzealous with the error checking. 1524fca8e0fSStefan Eßer 1534fca8e0fSStefan Eßer## 6.2.3 1544fca8e0fSStefan Eßer 1554fca8e0fSStefan EßerThis is a production release that moves `bc` to <https://git.gavinhoward.com>. 1564fca8e0fSStefan Eßer 1574fca8e0fSStefan EßerThat's all it does: update links. Users do ***NOT*** need to upgrade; there are 1584fca8e0fSStefan Eßerredirects that will stay in place indefinitely. This release is only for new 1594fca8e0fSStefan Eßerusers. 1604fca8e0fSStefan Eßer 161d101cdd6SStefan Eßer## 6.2.2 162d101cdd6SStefan Eßer 163d101cdd6SStefan EßerThis is a production release that fixes a bug. 164d101cdd6SStefan Eßer 165d101cdd6SStefan EßerThe bug was that if an array element was used as a parameter, and then a later 166d101cdd6SStefan Eßerparameter had the same name as the array whose element was used, `bc` would grab 167d101cdd6SStefan Eßerthe element from the new array parameter, not the actual element from before the 168d101cdd6SStefan Eßerfunction call. 169d101cdd6SStefan Eßer 170d101cdd6SStefan Eßer## 6.2.1 171d101cdd6SStefan Eßer 172d101cdd6SStefan EßerThis is a production release with one bug fix for a memory bug in history. 173d101cdd6SStefan Eßer 174d101cdd6SStefan Eßer## 6.2.0 175d101cdd6SStefan Eßer 176d101cdd6SStefan EßerThis is a production release with a new feature and a few bug fixes. 177d101cdd6SStefan Eßer 178d101cdd6SStefan EßerThe bug fixes include: 179d101cdd6SStefan Eßer 180d101cdd6SStefan Eßer* A crash when `bc` and `dc` are built using editline, but history is not 181d101cdd6SStefan Eßer activated. 182d101cdd6SStefan Eßer* A missing local in the `uint*()` family of functions in the extended math 183d101cdd6SStefan Eßer library. 184d101cdd6SStefan Eßer* A failure to clear the tail call list in `dc` on error. 185d101cdd6SStefan Eßer* A crash when attempting to swap characters in command-line history when no 186d101cdd6SStefan Eßer characters exist. 187d101cdd6SStefan Eßer* `SIGWINCH` was activated even when history was not. 188d101cdd6SStefan Eßer 189d101cdd6SStefan EßerThe new feature is that stack traces are now given for runtime errors. In debug 190d101cdd6SStefan Eßermode, the C source file and line of errors are given as well. 191d101cdd6SStefan Eßer 192d101cdd6SStefan Eßer## 6.1.1 193d101cdd6SStefan Eßer 194d101cdd6SStefan EßerThis is a production release that fixes a build issue with predefined builds and 195d101cdd6SStefan Eßergenerated tests. 196d101cdd6SStefan Eßer 197d101cdd6SStefan Eßer## 6.1.0 198d101cdd6SStefan Eßer 199d101cdd6SStefan EßerThis is a production release that fixes a discrepancy from the `bc` standard, 200d101cdd6SStefan Eßera couple of memory bugs, and adds new features. 201d101cdd6SStefan Eßer 202d101cdd6SStefan EßerThe discrepancy from the `bc` standard was with regards to the behavior of the 203d101cdd6SStefan Eßer`quit` command. This `bc` used to quit whenever it encountered `quit` during 204d101cdd6SStefan Eßerparsing, even if it was parsing a full file. Now, `bc` only quits when 205d101cdd6SStefan Eßerencountering `quit` *after* it has executed all executable statements up to that 206d101cdd6SStefan Eßerpoint. 207d101cdd6SStefan Eßer 208d101cdd6SStefan EßerThis behavior is slightly different from GNU `bc`, but users will only notice 209d101cdd6SStefan Eßerthe difference if they put `quit` on the same line as other statements. 210d101cdd6SStefan Eßer 211d101cdd6SStefan EßerThe first memory bug could be reproduced by assigning a string to a non-local 212d101cdd6SStefan Eßervariable in a function, then redefining the function with use of the same 213d101cdd6SStefan Eßernon-local variable, which would still refer to a string in the previous version 214d101cdd6SStefan Eßerof the function. 215d101cdd6SStefan Eßer 216d101cdd6SStefan EßerThe second memory bug was caused by passing an array argument to the `asciify()` 217d101cdd6SStefan Eßerbuilt-in function. In certain cases, that was wrongly allowed, and the 218d101cdd6SStefan Eßerinterpreter just assumed everything was correct and accessed memory. Now that 219d101cdd6SStefan Eßerarrays are allowed as arguments (see below), this is not an issue. 220d101cdd6SStefan Eßer 221d101cdd6SStefan EßerThe first feature was the addition of the `is_number()` built-in function (`u` 222d101cdd6SStefan Eßerin `dc`) that returns 1 if the runtime argument is a number and 0 otherwise. 223d101cdd6SStefan Eßer 224d101cdd6SStefan EßerThe second feature was the addition of the `is_string()` built-in function (`t` 225d101cdd6SStefan Eßerin `dc`) that returns 1 if the runtime argument is a string and 0 otherwise. 226d101cdd6SStefan Eßer 227d101cdd6SStefan EßerThese features were added because I realized that type-checking is necessary now 228d101cdd6SStefan Eßerthat strings can be assigned to variables in `bc` and because they've always 229d101cdd6SStefan Eßerbeen assignable to variables in `dc`. 230d101cdd6SStefan Eßer 231d101cdd6SStefan EßerThe last added feature is the ability of the `asciify()` built-in function in 232d101cdd6SStefan Eßer`bc` to convert a full array of numbers into a string. This means that 233d101cdd6SStefan Eßercharacter-by-character printing will not be necessary, and more strings than 234d101cdd6SStefan Eßerjust single-character ones will be able to be created. 235d101cdd6SStefan Eßer 236d101cdd6SStefan Eßer## 6.0.4 237d101cdd6SStefan Eßer 238d101cdd6SStefan EßerThis is a production release that most users will not need to upgrade to. 239d101cdd6SStefan Eßer 240d101cdd6SStefan EßerThis fixes a build bug for `bcl` only on OpenBSD. Users that do not need `bcl` 241d101cdd6SStefan Eßeror have not run into build errors with `bcl` do ***NOT*** need to upgrade. 242d101cdd6SStefan Eßer 243d101cdd6SStefan Eßer## 6.0.3 244d101cdd6SStefan Eßer 245d101cdd6SStefan EßerThis is a production release that fixes a build bug for cross-compilation. 246d101cdd6SStefan Eßer 247d101cdd6SStefan EßerUsers that do not need cross-compilation do ***NOT*** need to upgrade. 248d101cdd6SStefan Eßer 249d101cdd6SStefan Eßer## 6.0.2 250d101cdd6SStefan Eßer 251d101cdd6SStefan EßerThis is a production release that fixes two bugs: 252d101cdd6SStefan Eßer 253d101cdd6SStefan Eßer* The `-l` option overrode the `-S` option. 254d101cdd6SStefan Eßer* A double-free and crash when sending a `SIGINT` while executing expressions 255d101cdd6SStefan Eßer given on the command-line. 256d101cdd6SStefan Eßer 257d101cdd6SStefan Eßer## 6.0.1 258d101cdd6SStefan Eßer 259d101cdd6SStefan EßerThis is a production release that fixes memory bugs and memory leaks in `bcl`. 260d101cdd6SStefan Eßer 261d101cdd6SStefan EßerUsers that do not use `bcl` (use only `bc` and/or `dc`) do ***NOT*** need to 262d101cdd6SStefan Eßerupgrade. 263d101cdd6SStefan Eßer 264d101cdd6SStefan EßerThese happened because I was unaware that the `bcl` test was not hooked into the 265d101cdd6SStefan EßerValgrind test infrastructure. Then, when I ran the release script, which tests 266d101cdd6SStefan Eßereverything under Valgrind (or so I thought), it caught nothing, and I thought it 267d101cdd6SStefan Eßerwas safe. 268d101cdd6SStefan Eßer 269d101cdd6SStefan EßerBut it was not. 270d101cdd6SStefan Eßer 271d101cdd6SStefan EßerNevertheless, I have now run it under Valgrind and fixed all of the memory bugs 272d101cdd6SStefan Eßer(caused by not using `memset()` where I should have but previously didn't have 273d101cdd6SStefan Eßerto) and memory leaks. 274d101cdd6SStefan Eßer 275d101cdd6SStefan Eßer## 6.0.0 276d101cdd6SStefan Eßer 277d101cdd6SStefan EßerThis is a production release that fixes an oversight in the `bc` parser (that 278d101cdd6SStefan Eßersometimes caused the wrong error message) and adds a feature for compatibility 279d101cdd6SStefan Eßerwith the BSD `bc` and `dc`: turning off digit clamping when parsing numbers. 280d101cdd6SStefan Eßer 281d101cdd6SStefan EßerThe default for clamping can be set during the build (see the [build 282d101cdd6SStefan Eßermanual][13]), it can be set with the `BC_DIGIT_CLAMP` and `DC_DIGIT_CLAMP` 283d101cdd6SStefan Eßerenvironment variables, and it can be set with the `-c` and `-C` command-line 284d101cdd6SStefan Eßeroptions. 285d101cdd6SStefan Eßer 286d101cdd6SStefan EßerTurning off clamping was also added to the `bcl` library. 287d101cdd6SStefan Eßer 288d101cdd6SStefan EßerIn addition, signal handling was removed from the `bcl` library in order to add 289d101cdd6SStefan Eßerthe capability for multi-threading. This required a major version bump. I 290d101cdd6SStefan Eßerapologize to all library users (I don't know of any), but signals and threads do 291d101cdd6SStefan Eßernot play well together. 292d101cdd6SStefan Eßer 293d101cdd6SStefan EßerTo help with building, a convenience option (`-p`) to `configure.sh` was added 294d101cdd6SStefan Eßerto build a `bc` and `dc` that is by default compatible with either the BSD `bc` 295d101cdd6SStefan Eßerand `dc` or the GNU `bc` and `dc`. 296d101cdd6SStefan Eßer 297f53b5fe7SStefan Eßer## 5.3.3 298f53b5fe7SStefan Eßer 299f53b5fe7SStefan EßerThis is a production release that fixes a build problem in the FreeBSD base 300f53b5fe7SStefan Eßersystem. 301f53b5fe7SStefan Eßer 302f53b5fe7SStefan EßerAll other users do **NOT** need to upgrade. 303f53b5fe7SStefan Eßer 304f53b5fe7SStefan Eßer## 5.3.2 305f53b5fe7SStefan Eßer 306f53b5fe7SStefan EßerThis is a production release that fixes prompt bugs with editline and readline 307f53b5fe7SStefan Eßerwhere the `BC_PROMPT` environment variable was not being respected. 308f53b5fe7SStefan Eßer 309f53b5fe7SStefan EßerThis also fixes editline and readline output on `EOF`. 310f53b5fe7SStefan Eßer 31178bc019dSStefan Eßer## 5.3.1 31278bc019dSStefan Eßer 31378bc019dSStefan EßerThis is a production release that fixes a build problem in the FreeBSD base 31478bc019dSStefan Eßersystem, as well as a problem in the `en_US` locale. If you don't have problems 31578bc019dSStefan Eßerwith either, you do not need to upgrade. 31678bc019dSStefan Eßer 31778bc019dSStefan Eßer## 5.3.0 31878bc019dSStefan Eßer 31978bc019dSStefan EßerThis is a production release that adds features and has a few bug fixes. 32078bc019dSStefan Eßer 32178bc019dSStefan EßerFirst, support for editline and readline history has been added. To use 32278bc019dSStefan Eßereditline, pass `-e` to `configure.sh`, and to use readline, pass `-r`. 32378bc019dSStefan Eßer 32478bc019dSStefan EßerSecond, history support for Windows has been fixed and re-enabled. 32578bc019dSStefan Eßer 32678bc019dSStefan EßerThird, command-line options to set `scale`, `ibase`, `obase`, and `seed` were 32778bc019dSStefan Eßeradded. This was requested long ago, and I originally disagreed with the idea. 32878bc019dSStefan Eßer 32978bc019dSStefan EßerFourth, the manuals had typos and were missing information. That has been fixed. 33078bc019dSStefan Eßer 33178bc019dSStefan EßerFifth, the manuals received different formatting to be more readable as 33278bc019dSStefan Eßermanpages. 33378bc019dSStefan Eßer 334bbd60e2cSStefan Eßer## 5.2.5 335bbd60e2cSStefan Eßer 336bbd60e2cSStefan EßerThis is a production release that fixes this `bc`'s behavior on `^D` to match 337bbd60e2cSStefan EßerGNU `bc`. 338bbd60e2cSStefan Eßer 339b85b9c88SStefan Eßer## 5.2.4 340b85b9c88SStefan Eßer 341b85b9c88SStefan EßerThis is a production release that fixes two bugs in history: 342b85b9c88SStefan Eßer 343b85b9c88SStefan Eßer* Without prompt, the cursor could not be placed on the first character in a 344b85b9c88SStefan Eßer line. 345b85b9c88SStefan Eßer* Home and End key handling in `tmux` was fixed. 346b85b9c88SStefan Eßer 347b85b9c88SStefan EßerAny users that do not care about these improvements do not need to upgrade. 348b85b9c88SStefan Eßer 34923210c9fSStefan Eßer## 5.2.3 35023210c9fSStefan Eßer 35123210c9fSStefan EßerThis is a production release that fixes one bug, a parse error when passing a 35223210c9fSStefan Eßerfile to `bc` using `-f` if that file had a multiline comment or string in it. 35323210c9fSStefan Eßer 35400698711SStefan Eßer## 5.2.2 35500698711SStefan Eßer 35600698711SStefan EßerThis is a production release that fixes one bug, a segmentation fault if 35700698711SStefan Eßer`argv[0]` equals `NULL`. 35800698711SStefan Eßer 35900698711SStefan EßerThis is not a critical bug; there will be no vulnerability as far as I can tell. 36000698711SStefan EßerThere is no need to update if you do not wish to. 36100698711SStefan Eßer 36210041e99SStefan Eßer## 5.2.1 36310041e99SStefan Eßer 36410041e99SStefan EßerThis is a production release that fixes two parse bugs when in POSIX standard 36510041e99SStefan Eßermode. One of these bugs was due to a quirk of the POSIX grammar, and the other 36610041e99SStefan Eßerwas because `bc` was too strict. 36710041e99SStefan Eßer 36810041e99SStefan Eßer## 5.2.0 36910041e99SStefan Eßer 37010041e99SStefan EßerThis is a production release that adds a new feature, fixes some bugs, and adds 37110041e99SStefan Eßerout-of-source builds and a `pkg-config` file for `bcl`. 37210041e99SStefan Eßer 37310041e99SStefan EßerThe new feature is the ability to turn off exiting on expressions. It is also 37410041e99SStefan Eßerpossible to set the default using `configure.sh`. This behavior used to exist 37510041e99SStefan Eßerwith the `BC_EXPR_EXIT` environment variable, which is now used again. 37610041e99SStefan Eßer 37710041e99SStefan EßerBugs fixed include: 37810041e99SStefan Eßer 37910041e99SStefan Eßer* Some possible race conditions with error handling. 38010041e99SStefan Eßer* Install and uninstall targets for `bcl` did not work. 38110041e99SStefan Eßer 382a30efc5cSStefan Eßer## 5.1.1 383a30efc5cSStefan Eßer 384a30efc5cSStefan EßerThis is a production release that completes a bug fix from `5.1.0`. The bug 385a30efc5cSStefan Eßerexists in all versions of `bc`. 386a30efc5cSStefan Eßer 387a30efc5cSStefan EßerThe bug was that `if` statements without `else` statements would not be handled 388a30efc5cSStefan Eßercorrectly at the end of files or right before a function definition. 389a30efc5cSStefan Eßer 390d43fa8efSStefan Eßer## 5.1.0 391d43fa8efSStefan Eßer 392d43fa8efSStefan EßerThis is a production release with some fixes and new features. 393d43fa8efSStefan Eßer 394d43fa8efSStefan Eßer* Fixed a bug where an `if` statement without an `else` before defining a 395d43fa8efSStefan Eßer function caused an error. 396d43fa8efSStefan Eßer* Fixed a bug with the `bc` banner and `-q`. 397d43fa8efSStefan Eßer* Fixed a bug on Windows where files were not read correctly. 398d43fa8efSStefan Eßer* Added a command-line flag (`-z`) to make `bc` and `dc` print leading zeroes on 399d43fa8efSStefan Eßer numbers `-1 < x < 1`. 400d43fa8efSStefan Eßer* Added four functions to `lib2.bc` (`plz()`, `plznl()`, `pnlz()`, and 401d43fa8efSStefan Eßer `pnlznl()`) to allow printing numbers with or without leading zeros, despite 402d43fa8efSStefan Eßer the use of `-z` or not. 403d43fa8efSStefan Eßer* Added builtin functions to query global state like line length, global stacks, 404d43fa8efSStefan Eßer and leading zeroes. 405d43fa8efSStefan Eßer* Added a command-line flag (`-L`) to disable wrapping when printing numbers. 406d43fa8efSStefan Eßer* Improved builds on Windows. 407d43fa8efSStefan Eßer 408662087dfSStefan Eßer## 5.0.2 409662087dfSStefan Eßer 410662087dfSStefan EßerThis is a production release with one fix for a flaky test. If you have not 411662087dfSStefan Eßerexperienced problems with the test suite, you do ***NOT*** need to upgrade. 412662087dfSStefan Eßer 413662087dfSStefan EßerThe test was one that tested whether `bc` fails gracefully when it can't 414662087dfSStefan Eßerallocate memory. Unfortunately, there are cases when Linux and FreeBSD lie and 415662087dfSStefan Eßerpretend to allocate the memory. 416662087dfSStefan Eßer 417662087dfSStefan EßerThe reason they do this is because a lot of programs don't use all of the memory 418662087dfSStefan Eßerthey allocate, so those OS's usually get away with it. 419662087dfSStefan Eßer 420662087dfSStefan EßerHowever, this `bc` uses all of the memory it allocates (at least at page 421662087dfSStefan Eßergranularity), so when it tries to use the memory, FreeBSD and Linux kill it. 422662087dfSStefan Eßer 423662087dfSStefan EßerThis only happens sometimes, however. Other times (on my machine), they do, in 424662087dfSStefan Eßerfact, refuse the request. 425662087dfSStefan Eßer 426662087dfSStefan EßerSo I changed the test to not test for that because I think the graceful failure 427662087dfSStefan Eßercode won't really change much. 428662087dfSStefan Eßer 429662087dfSStefan Eßer## 5.0.1 430662087dfSStefan Eßer 431662087dfSStefan EßerThis is a production release with two fixes: 432662087dfSStefan Eßer 433662087dfSStefan Eßer* Fix for the build on Mac OSX. 434662087dfSStefan Eßer* Fix for the build on Android. 435662087dfSStefan Eßer 436662087dfSStefan EßerUsers that do not use those platforms do ***NOT*** need to update. 437662087dfSStefan Eßer 43844d4804dSStefan Eßer## 5.0.0 43944d4804dSStefan Eßer 44044d4804dSStefan EßerThis is a major production release with several changes: 44144d4804dSStefan Eßer 44244d4804dSStefan Eßer* Added support for OpenBSD's `pledge()` and `unveil()`. 44344d4804dSStefan Eßer* Fixed print bug where a backslash newline combo was printed even if only one 44444d4804dSStefan Eßer digit was left, something I blindly copied from GNU `bc`, like a fool. 44544d4804dSStefan Eßer* Fixed bugs in the manuals. 44644d4804dSStefan Eßer* Fixed a possible multiplication overflow in power. 44744d4804dSStefan Eßer* Temporary numbers are garbage collected if allocation fails, and the 44844d4804dSStefan Eßer allocation is retried. This is to make `bc` and `dc` more resilient to running 44944d4804dSStefan Eßer out of memory. 45044d4804dSStefan Eßer* Limited the number of temporary numbers and made the space for them static so 45144d4804dSStefan Eßer that allocating more space for them cannot fail. 45244d4804dSStefan Eßer* Allowed integers with non-zero `scale` to be used with power, places, and 45344d4804dSStefan Eßer shift operators. 45444d4804dSStefan Eßer* Added greatest common divisor and least common multiple to `lib2.bc`. 45544d4804dSStefan Eßer* Added `SIGQUIT` handling to history. 45644d4804dSStefan Eßer* Added a command to `dc` (`y`) to get the length of register stacks. 45744d4804dSStefan Eßer* Fixed multi-digit bugs in `lib2.bc`. 45844d4804dSStefan Eßer* Removed the no prompt build option. 45944d4804dSStefan Eßer* Created settings that builders can set defaults for and users can set their 46044d4804dSStefan Eßer preferences for. This includes the `bc` banner, resetting on `SIGINT`, TTY 46144d4804dSStefan Eßer mode, and prompt. 46244d4804dSStefan Eßer* Added history support to Windows. 46344d4804dSStefan Eßer* Fixed bugs with the handling of register names in `dc`. 46444d4804dSStefan Eßer* Fixed bugs with multi-line comments and strings in both calculators. 46544d4804dSStefan Eßer* Added a new error type and message for `dc` when register stacks don't have 46644d4804dSStefan Eßer enough items. 46744d4804dSStefan Eßer* Optimized string allocation. 46844d4804dSStefan Eßer* Made `bc` and `dc` UTF-8 capable. 46944d4804dSStefan Eßer* Fixed a bug with `void` functions. 47044d4804dSStefan Eßer* Fixed a misspelled symbol in `bcl`. This is technically a breaking change, 47144d4804dSStefan Eßer which requires this to be `5.0.0`. 47244d4804dSStefan Eßer* Added the ability for users to get the copyright banner back. 47344d4804dSStefan Eßer* Added the ability for users to have `bc` and `dc` quit on `SIGINT`. 47444d4804dSStefan Eßer* Added the ability for users to disable prompt and TTY mode by environment 47544d4804dSStefan Eßer variables. 47644d4804dSStefan Eßer* Added the ability for users to redefine keywords. This is another reason this 47744d4804dSStefan Eßer is `5.0.0`. 47844d4804dSStefan Eßer* Added `dc`'s modular exponentiation and divmod to `bc`. 47944d4804dSStefan Eßer* Added the ability to assign strings to variables and array elements and pass 48044d4804dSStefan Eßer them to functions in `bc`. 48144d4804dSStefan Eßer* Added `dc`'s asciify command and stream printing to `bc`. 48244d4804dSStefan Eßer* Added a command to `dc` (`Y`) to get the length of an array. 48344d4804dSStefan Eßer* Added a command to `dc` (`,`) to get the depth of the execution stack. 48444d4804dSStefan Eßer* Added bitwise and, or, xor, left shift, right shift, reverse, left rotate, 48544d4804dSStefan Eßer right rotate, and mod functions to `lib2.bc`. 48644d4804dSStefan Eßer* Added the functions `s2u(x)` and `s2un(x,n)`, to `lib2.bc`. 48744d4804dSStefan Eßer 4888c39e252SStefan Eßer## 4.0.2 4898c39e252SStefan Eßer 4908c39e252SStefan EßerThis is a production release that fixes two bugs: 4918c39e252SStefan Eßer 4928c39e252SStefan Eßer1. If no files are used and the first statement on `stdin` is invalid, `scale` 4938c39e252SStefan Eßer would not be set to `20` even if `-l` was used. 4948c39e252SStefan Eßer2. When using history, `bc` failed to respond properly to `SIGSTOP` and 4958c39e252SStefan Eßer `SIGTSTP`. 4968c39e252SStefan Eßer 4978ea90135SStefan Eßer## 4.0.1 4988ea90135SStefan Eßer 4998ea90135SStefan EßerThis is a production release that only adds one thing: flushing output when it 5008ea90135SStefan Eßeris printed with a print statement. 5018ea90135SStefan Eßer 5027e5c51e5SStefan Eßer## 4.0.0 5037e5c51e5SStefan Eßer 5047e5c51e5SStefan EßerThis is a production release with many fixes, a new command-line option, and a 5057e5c51e5SStefan Eßerbig surprise: 5067e5c51e5SStefan Eßer 5077e5c51e5SStefan Eßer* A bug was fixed in `dc`'s `P` command where the item on the stack was *not* 5087e5c51e5SStefan Eßer popped. 5097e5c51e5SStefan Eßer* Various bugs in the manuals have been fixed. 5107e5c51e5SStefan Eßer* A known bug was fixed where history did not interact well with prompts printed 5117e5c51e5SStefan Eßer by user code without newlines. 5127e5c51e5SStefan Eßer* A new command-line option, `-R` and `--no-read-prompt` was added to disable 5137e5c51e5SStefan Eßer just the prompt when using `read()` (`bc`) or `?` (`dc`). 5147e5c51e5SStefan Eßer* And finally, **official support for Windows was added**. 5157e5c51e5SStefan Eßer 5167e5c51e5SStefan EßerThe last item is why this is a major version bump. 5177e5c51e5SStefan Eßer 5187e5c51e5SStefan EßerCurrently, only one set of build options (extra math and prompt enabled, history 5197e5c51e5SStefan Eßerand NLS/locale support disabled, both calculators enabled) is supported on 5207e5c51e5SStefan EßerWindows. However, both debug and release builds are supported. 5217e5c51e5SStefan Eßer 5227e5c51e5SStefan EßerIn addition, Windows builds are supported for the the library (`bcl`). 5237e5c51e5SStefan Eßer 5247e5c51e5SStefan EßerFor more details about how to build on Windows, see the [README][5] or the 5257e5c51e5SStefan Eßer[build manual][13]. 5267e5c51e5SStefan Eßer 5279300e880SStefan Eßer## 3.3.4 5289300e880SStefan Eßer 5299300e880SStefan EßerThis is a production release that fixes a small bug. 5309300e880SStefan Eßer 5319300e880SStefan EßerThe bug was that output was not flushed before a `read()` call, so prompts 5329300e880SStefan Eßerwithout a newline on the end were not flushed before the `read()` call. 5339300e880SStefan Eßer 5349300e880SStefan EßerThis is such a tiny bug that users only need to upgrade if they are affected. 5359300e880SStefan Eßer 536028616d0SStefan Eßer## 3.3.3 537028616d0SStefan Eßer 538028616d0SStefan EßerThis is a production release with one tweak and fixes for manuals. 539028616d0SStefan Eßer 540028616d0SStefan EßerThe tweak is that `length(0)` returns `1` instead of `0`. In `3.3.1`, I changed 541028616d0SStefan Eßerit so `length(0.x)`, where `x` could be any number of digits, returned the 542028616d0SStefan Eßer`scale`, but `length(0)` still returned `0` because I believe that `0` has `0` 543028616d0SStefan Eßersignificant digits. 544028616d0SStefan Eßer 545028616d0SStefan EßerAfter request of FreeBSD and considering the arguments of a mathematician, 546028616d0SStefan Eßercompatibility with other `bc`'s, and the expectations of users, I decided to 547028616d0SStefan Eßermake the change. 548028616d0SStefan Eßer 549028616d0SStefan EßerThe fixes for manuals fixed a bug where `--` was rendered as `-`. 550028616d0SStefan Eßer 551028616d0SStefan Eßer## 3.3.2 552028616d0SStefan Eßer 553028616d0SStefan EßerThis is a production release that fixes a divide-by-zero bug in `root()` in the 554028616d0SStefan Eßer[extended math library][16]. All previous versions with `root()` have the bug. 555028616d0SStefan Eßer 556028616d0SStefan Eßer## 3.3.1 557028616d0SStefan Eßer 558028616d0SStefan EßerThis is a production release that fixes a bug. 559028616d0SStefan Eßer 560028616d0SStefan EßerThe bug was in the reporting of number length when the value was 0. 561028616d0SStefan Eßer 5629a995fe1SStefan Eßer## 3.3.0 5639a995fe1SStefan Eßer 5649a995fe1SStefan EßerThis is a production release that changes one behavior and fixes documentation 5659a995fe1SStefan Eßerbugs. 5669a995fe1SStefan Eßer 5679a995fe1SStefan EßerThe changed behavior is the treatment of `-e` and `-f` when given through 5689a995fe1SStefan Eßer`BC_ENV_ARGS` or `DC_ENV_ARGS`. Now `bc` and `dc` do not exit when those options 5699a995fe1SStefan Eßer(or their equivalents) are given through those environment variables. However, 5709a995fe1SStefan Eßer`bc` and `dc` still exit when they or their equivalents are given on the 5719a995fe1SStefan Eßercommand-line. 5729a995fe1SStefan Eßer 5739a995fe1SStefan Eßer## 3.2.7 5749a995fe1SStefan Eßer 5759a995fe1SStefan EßerThis is a production release that removes a small non-portable shell operation 5769a995fe1SStefan Eßerin `configure.sh`. This problem was only noticed on OpenBSD, not FreeBSD or 5779a995fe1SStefan EßerLinux. 5789a995fe1SStefan Eßer 5799a995fe1SStefan EßerNon-OpenBSD users do ***NOT*** need to upgrade, although NetBSD users may also 5809a995fe1SStefan Eßerneed to upgrade. 5819a995fe1SStefan Eßer 58210328f8bSStefan Eßer## 3.2.6 58310328f8bSStefan Eßer 58410328f8bSStefan EßerThis is a production release that fixes the build on FreeBSD. 58510328f8bSStefan Eßer 58610328f8bSStefan EßerThere was a syntax error in `configure.sh` that the Linux shell did not catch, 58710328f8bSStefan Eßerand FreeBSD depends on the existence of `tests/all.sh`. 58810328f8bSStefan Eßer 58910328f8bSStefan EßerAll users that already upgraded to `3.2.5` should update to this release, with 59010328f8bSStefan Eßermy apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in 59110328f8bSStefan Eßerfavor of this version. 59210328f8bSStefan Eßer 59310328f8bSStefan Eßer## 3.2.5 59410328f8bSStefan Eßer 59510328f8bSStefan EßerThis is a production release that fixes several bugs and adds a couple small 59610328f8bSStefan Eßerthings. 59710328f8bSStefan Eßer 59810328f8bSStefan EßerThe two most important bugs were bugs that causes `dc` to access memory 59910328f8bSStefan Eßerout-of-bounds (crash in debug builds). This was found by upgrading to `afl++` 60010328f8bSStefan Eßerfrom `afl`. Both were caused by a failure to distinguish between the same two 60110328f8bSStefan Eßercases. 60210328f8bSStefan Eßer 60310328f8bSStefan EßerAnother bug was the failure to put all of the licenses in the `LICENSE.md` file. 60410328f8bSStefan Eßer 60510328f8bSStefan EßerThird, some warnings by `scan-build` were found and eliminated. This needed one 60610328f8bSStefan Eßerbig change: `bc` and `dc` now bail out as fast as possible on fatal errors 60710328f8bSStefan Eßerinstead of unwinding the stack. 60810328f8bSStefan Eßer 60910328f8bSStefan EßerFourth, the pseudo-random number now attempts to seed itself with `/dev/random` 61010328f8bSStefan Eßerif `/dev/urandom` fails. 61110328f8bSStefan Eßer 61210328f8bSStefan EßerFinally, this release has a few quality-of-life changes to the build system. The 61310328f8bSStefan Eßerusage should not change at all; the only thing that changed was making sure the 61410328f8bSStefan Eßer`Makefile.in` was written to rebuild properly when headers changed and to not 61510328f8bSStefan Eßerrebuild when not necessary. 61610328f8bSStefan Eßer 617e458944cSStefan Eßer## 3.2.4 618e458944cSStefan Eßer 619e458944cSStefan EßerThis is a production release that fixes a warning on `gcc` 6 or older, which 620e458944cSStefan Eßerdoes not have an attribute that is used. 621e458944cSStefan Eßer 622e458944cSStefan EßerUsers do ***NOT*** need to upgrade if they don't use `gcc` 6 or older. 623e458944cSStefan Eßer 624c6bfc896SStefan Eßer## 3.2.3 625c6bfc896SStefan Eßer 626c6bfc896SStefan EßerThis is a production release that fixes a bug in `gen/strgen.sh`. I recently 627c6bfc896SStefan Eßerchanged `gen/strgen.c`, but I did not change `gen/strgen.sh`. 628c6bfc896SStefan Eßer 629c6bfc896SStefan EßerUsers that do not use `gen/strgen.sh` do not need to upgrade. 630c6bfc896SStefan Eßer 631c6bfc896SStefan Eßer## 3.2.2 632c6bfc896SStefan Eßer 633c6bfc896SStefan EßerThis is a production release that fixes a portability bug in `configure.sh`. The 634c6bfc896SStefan Eßerbug was using the GNU `find` extension `-wholename`. 635c6bfc896SStefan Eßer 636c6bfc896SStefan Eßer## 3.2.1 637c6bfc896SStefan Eßer 638c6bfc896SStefan EßerThis is a production release that has one fix for `bcl(3)`. It is technically 639c6bfc896SStefan Eßernot a bug fix since the behavior is undefined, but the `BclNumber`s that 640c6bfc896SStefan Eßer`bcl_divmod()` returns will be set to `BCL_ERROR_INVALID_NUM` if there is an 641c6bfc896SStefan Eßererror. Previously, they were not set. 642c6bfc896SStefan Eßer 64350696a6eSStefan Eßer## 3.2.0 64450696a6eSStefan Eßer 64550696a6eSStefan EßerThis is a production release that has one bug fix and a major addition. 64650696a6eSStefan Eßer 64750696a6eSStefan EßerThe bug fix was a missing `auto` variable in the bessel `j()` function in the 64850696a6eSStefan Eßermath library. 64950696a6eSStefan Eßer 65050696a6eSStefan EßerThe major addition is a way to build a version of `bc`'s math code as a library. 65150696a6eSStefan EßerThis is done with the `-a` option to `configure.sh`. The API for the library can 65250696a6eSStefan Eßerbe read in `./manuals/bcl.3.md` or `man bcl` once the library is installed with 65350696a6eSStefan Eßer`make install`. 65450696a6eSStefan Eßer 65550696a6eSStefan EßerThis library was requested by developers before I even finished version 1.0, but 65650696a6eSStefan EßerI could not figure out how to do it until now. 65750696a6eSStefan Eßer 65850696a6eSStefan EßerIf the library has API breaking changes, the major version of `bc` will be 65950696a6eSStefan Eßerincremented. 66050696a6eSStefan Eßer 661d213476dSStefan Eßer## 3.1.6 662d213476dSStefan Eßer 663d213476dSStefan EßerThis is a production release that fixes a new warning from Clang 12 for FreeBSD 664d213476dSStefan Eßerand also removes some possible undefined behavior found by UBSan that compilers 665d213476dSStefan Eßerdid not seem to take advantage of. 666d213476dSStefan Eßer 667d213476dSStefan EßerUsers do ***NOT*** need to upgrade, if they do not want to. 668d213476dSStefan Eßer 669119656bcSStefan Eßer## 3.1.5 670119656bcSStefan Eßer 671119656bcSStefan EßerThis is a production release that fixes the Chinese locales (which caused `bc` 672119656bcSStefan Eßerto crash) and a crash caused by `bc` executing code when it should not have been 673119656bcSStefan Eßerable to. 674119656bcSStefan Eßer 675119656bcSStefan Eßer***ALL USERS SHOULD UPGRADE.*** 676119656bcSStefan Eßer 6775d934bc0SStefan Eßer## 3.1.4 6785d934bc0SStefan Eßer 6795d934bc0SStefan EßerThis is a production release that fixes one bug, changes two behaviors, and 6805d934bc0SStefan Eßerremoves one environment variable. 6815d934bc0SStefan Eßer 6825d934bc0SStefan EßerThe bug is like the one in the last release except it applies if files are being 6835d934bc0SStefan Eßerexecuted. I also made the fix more general. 6845d934bc0SStefan Eßer 6855d934bc0SStefan EßerThe behavior that was changed is that `bc` now exits when given `-e`, `-f`, 6865d934bc0SStefan Eßer`--expression` or `--file`. However, if the last one of those is `-f-` (using 6875d934bc0SStefan Eßer`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of 6885d934bc0SStefan Eßerthe `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits. 6895d934bc0SStefan Eßer 6905d934bc0SStefan EßerNext, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables 6915d934bc0SStefan Eßersince their use is not needed with the behavior change. 6925d934bc0SStefan Eßer 6935d934bc0SStefan EßerFinally, I made it so `bc` does not print the header, though the `-q` and 6945d934bc0SStefan Eßer`--quiet` options were kept for compatibility with GNU `bc`. 6955d934bc0SStefan Eßer 696cf7becd2SStefan Eßer## 3.1.3 697cf7becd2SStefan Eßer 698cf7becd2SStefan EßerThis is a production release that fixes one minor bug: if `bc` was invoked like 699cf7becd2SStefan Eßerthe following, it would error: 700cf7becd2SStefan Eßer 701cf7becd2SStefan Eßer``` 702cf7becd2SStefan Eßerecho "if (1 < 3) 1" | bc 703cf7becd2SStefan Eßer``` 704cf7becd2SStefan Eßer 705cf7becd2SStefan EßerUnless users run into this bug, they do not need to upgrade, but it is suggested 706cf7becd2SStefan Eßerthat they do. 707cf7becd2SStefan Eßer 708cf7becd2SStefan Eßer## 3.1.2 709cf7becd2SStefan Eßer 710cf7becd2SStefan EßerThis is a production release that adds a way to install *all* locales. Users do 711cf7becd2SStefan Eßer***NOT*** need to upgrade. 712cf7becd2SStefan Eßer 713cf7becd2SStefan EßerFor package maintainers wishing to make use of the change, just pass `-l` to 714cf7becd2SStefan Eßer`configure.sh`. 715cf7becd2SStefan Eßer 7163aa99676SStefan Eßer## 3.1.1 7173aa99676SStefan Eßer 7183aa99676SStefan EßerThis is a production release that adds two Spanish locales. Users do ***NOT*** 7193aa99676SStefan Eßerneed to upgrade, unless they want those locales. 7203aa99676SStefan Eßer 7213aa99676SStefan Eßer## 3.1.0 7223aa99676SStefan Eßer 7233aa99676SStefan EßerThis is a production release that adjusts one behavior, fixes eight bugs, and 7243aa99676SStefan Eßerimproves manpages for FreeBSD. Because this release fixes bugs, **users and 7253aa99676SStefan Eßerpackage maintainers should update to this version as soon as possible**. 7263aa99676SStefan Eßer 7273aa99676SStefan EßerThe behavior that was adjusted was how code from the `-e` and `-f` arguments 7283aa99676SStefan Eßer(and equivalents) were executed. They used to be executed as one big chunk, but 7293aa99676SStefan Eßerin this release, they are now executed line-by-line. 7303aa99676SStefan Eßer 7313aa99676SStefan EßerThe first bug fix in how output to `stdout` was handled in `SIGINT`. If a 7323aa99676SStefan Eßer`SIGINT` came in, the `stdout` buffer was not correctly flushed. In fact, a 7333aa99676SStefan Eßerclean-up function was not getting called. This release fixes that bug. 7343aa99676SStefan Eßer 7353aa99676SStefan EßerThe second bug is in how `dc` handled input from `stdin`. This affected `bc` as 7363aa99676SStefan Eßerwell since it was a mishandling of the `stdin` buffer. 7373aa99676SStefan Eßer 7383aa99676SStefan EßerThe third fixed bug was that `bc` and `dc` could `abort()` (in debug mode) when 7393aa99676SStefan Eßerreceiving a `SIGTERM`. This one was a race condition with pushing and popping 7403aa99676SStefan Eßeritems onto and out of vectors. 7413aa99676SStefan Eßer 7423aa99676SStefan EßerThe fourth bug fixed was that `bc` could leave extra items on the stack and 7433aa99676SStefan Eßerthus, not properly clean up some memory. (The memory would still get 7443aa99676SStefan Eßer`free()`'ed, but it would not be `free()`'ed when it could have been.) 7453aa99676SStefan Eßer 7463aa99676SStefan EßerThe next two bugs were bugs in `bc`'s parser that caused crashes when executing 7473aa99676SStefan Eßerthe resulting code. 7483aa99676SStefan Eßer 7493aa99676SStefan EßerThe last two bugs were crashes in `dc` that resulted from mishandling of 7503aa99676SStefan Eßerstrings. 7513aa99676SStefan Eßer 7523aa99676SStefan EßerThe manpage improvement was done by switching from [ronn][20] to [Pandoc][21] to 7533aa99676SStefan Eßergenerate manpages. Pandoc generates much cleaner manpages and doesn't leave 7543aa99676SStefan Eßerblank lines where they shouldn't be. 7553aa99676SStefan Eßer 7563aa99676SStefan Eßer## 3.0.3 7573aa99676SStefan Eßer 7583aa99676SStefan EßerThis is a production release that adds one new feature: specific manpages. 7593aa99676SStefan Eßer 7603aa99676SStefan EßerBefore this release, `bc` and `dc` only used one manpage each that referred to 7613aa99676SStefan Eßervarious build options. This release changes it so there is one manpage set per 7623aa99676SStefan Eßerrelevant build type. Each manual only has information about its particular 7633aa99676SStefan Eßerbuild, and `configure.sh` selects the correct set for install. 7643aa99676SStefan Eßer 765252884aeSStefan Eßer## 3.0.2 766252884aeSStefan Eßer 767252884aeSStefan EßerThis is a production release that adds `utf8` locale symlinks and removes an 768252884aeSStefan Eßerunused `auto` variable from the `ceil()` function in the [extended math 769252884aeSStefan Eßerlibrary][16]. 770252884aeSStefan Eßer 771252884aeSStefan EßerUsers do ***NOT*** need to update unless they want the locales. 772252884aeSStefan Eßer 773252884aeSStefan Eßer## 3.0.1 774252884aeSStefan Eßer 775252884aeSStefan EßerThis is a production release with two small changes. Users do ***NOT*** need to 776252884aeSStefan Eßerupgrade to this release; however, if they haven't upgraded to `3.0.0` yet, it 777252884aeSStefan Eßermay be worthwhile to upgrade to this release. 778252884aeSStefan Eßer 779252884aeSStefan EßerThe first change is fixing a compiler warning on FreeBSD with strict warnings 780252884aeSStefan Eßeron. 781252884aeSStefan Eßer 782252884aeSStefan EßerThe second change is to make the new implementation of `ceil()` in `lib2.bc` 783252884aeSStefan Eßermuch more efficient. 784252884aeSStefan Eßer 785252884aeSStefan Eßer## 3.0.0 786252884aeSStefan Eßer 787252884aeSStefan Eßer*Notes for package maintainers:* 788252884aeSStefan Eßer 789252884aeSStefan Eßer*First, the `2.7.0` release series saw a change in the option parsing. This made 790252884aeSStefan Eßerme change one error message and add a few others. The error message that was 791252884aeSStefan Eßerchanged removed one format specifier. This means that `printf()` will seqfault 792252884aeSStefan Eßeron old locale files. Unfortunately, `bc` cannot use any locale files except the 793252884aeSStefan Eßerglobal ones that are already installed, so it will use the previous ones while 794252884aeSStefan Eßerrunning tests during install. **If `bc` segfaults while running arg tests when 795252884aeSStefan Eßerupdating, it is because the global locale files have not been replaced. Make 796252884aeSStefan Eßersure to either prevent the test suite from running on update or remove the old 7973aa99676SStefan Eßerlocale files before updating.** (Removing the locale files can be done with 79844d4804dSStefan Eßer`make uninstall` or by running the [`locale_uninstall.sh`][22] script.) Once 79944d4804dSStefan Eßerthis is done, `bc` should install without problems.* 800252884aeSStefan Eßer 801252884aeSStefan Eßer*Second, **the option to build without signal support has been removed**. See 802252884aeSStefan Eßerbelow for the reasons why.* 803252884aeSStefan Eßer 804252884aeSStefan EßerThis is a production release with some small bug fixes, a few improvements, 805252884aeSStefan Eßerthree major bug fixes, and a complete redesign of `bc`'s error and signal 806252884aeSStefan Eßerhandling. **Users and package maintainers should update to this version as soon 807252884aeSStefan Eßeras possible.** 808252884aeSStefan Eßer 809252884aeSStefan EßerThe first major bug fix was in how `bc` executed files. Previously, a whole file 810252884aeSStefan Eßerwas parsed before it was executed, but if a function is defined *after* code, 811252884aeSStefan Eßerespecially if the function definition was actually a redefinition, and the code 812252884aeSStefan Eßerbefore the definition referred to the previous function, this `bc` would replace 813252884aeSStefan Eßerthe function before executing any code. The fix was to make sure that all code 814252884aeSStefan Eßerthat existed before a function definition was executed. 815252884aeSStefan Eßer 816252884aeSStefan EßerThe second major bug fix was in `bc`'s `lib2.bc`. The `ceil()` function had a 817252884aeSStefan Eßerbug where a `0` in the decimal place after the truncation position, caused it to 818252884aeSStefan Eßeroutput the wrong numbers if there was any non-zero digit after. 819252884aeSStefan Eßer 820252884aeSStefan EßerThe third major bug is that when passing parameters to functions, if an 821252884aeSStefan Eßerexpression included an array (not an array element) as a parameter, it was 822252884aeSStefan Eßeraccepted, when it should have been rejected. It is now correctly rejected. 823252884aeSStefan Eßer 824252884aeSStefan EßerBeyond that, this `bc` got several improvements that both sped it up, improved 825252884aeSStefan Eßerthe handling of signals, and improved the error handling. 826252884aeSStefan Eßer 827252884aeSStefan EßerFirst, the requirements for `bc` were pushed back to POSIX 2008. `bc` uses one 828252884aeSStefan Eßerfunction, `strdup()`, which is not in POSIX 2001, and it is in the X/Open System 829252884aeSStefan EßerInterfaces group 2001. It is, however, in POSIX 2008, and since POSIX 2008 is 830252884aeSStefan Eßerold enough to be supported anywhere that I care, that should be the requirement. 831252884aeSStefan Eßer 832e6857bd4SStefan EßerSecond, the `BcVm` global variable was put into `bss`. This actually slightly 833252884aeSStefan Eßerreduces the size of the executable from a massive code shrink, and it will stop 834252884aeSStefan Eßer`bc` from allocating a large set of memory when `bc` starts. 835252884aeSStefan Eßer 836252884aeSStefan EßerThird, the default Karatsuba length was updated from 64 to 32 after making the 837252884aeSStefan Eßeroptimization changes below, since 32 is going to be better than 64 after the 838252884aeSStefan Eßerchanges. 839252884aeSStefan Eßer 840252884aeSStefan EßerFourth, Spanish translations were added. 841252884aeSStefan Eßer 842252884aeSStefan EßerFifth, the interpreter received a speedup to make performance on non-math-heavy 843252884aeSStefan Eßerscripts more competitive with GNU `bc`. While improvements did, in fact, get it 844252884aeSStefan Eßermuch closer (see the [benchmarks][19]), it isn't quite there. 845252884aeSStefan Eßer 846252884aeSStefan EßerThere were several things done to speed up the interpreter: 847252884aeSStefan Eßer 848252884aeSStefan EßerFirst, several small inefficiencies were removed. These inefficiencies included 849252884aeSStefan Eßercalling the function `bc_vec_pop(v)` twice instead of calling 850252884aeSStefan Eßer`bc_vec_npop(v, 2)`. They also included an extra function call for checking the 851252884aeSStefan Eßersize of the stack and checking the size of the stack more than once on several 852252884aeSStefan Eßeroperations. 853252884aeSStefan Eßer 854252884aeSStefan EßerSecond, since the current `bc` function is the one that stores constants and 855252884aeSStefan Eßerstrings, the program caches pointers to the current function's vectors of 856252884aeSStefan Eßerconstants and strings to prevent needing to grab the current function in order 857252884aeSStefan Eßerto grab a constant or a string. 858252884aeSStefan Eßer 859252884aeSStefan EßerThird, `bc` tries to reuse `BcNum`'s (the internal representation of 860252884aeSStefan Eßerarbitary-precision numbers). If a `BcNum` has the default capacity of 861252884aeSStefan Eßer`BC_NUM_DEF_SIZE` (32 on 64-bit and 16 on 32-bit) when it is freed, it is added 862252884aeSStefan Eßerto a list of available `BcNum`'s. And then, when a `BcNum` is allocated with a 863252884aeSStefan Eßercapacity of `BC_NUM_DEF_SIZE` and any `BcNum`'s exist on the list of reusable 864252884aeSStefan Eßerones, one of those ones is grabbed instead. 865252884aeSStefan Eßer 866252884aeSStefan EßerIn order to support these changes, the `BC_NUM_DEF_SIZE` was changed. It used to 867252884aeSStefan Eßerbe 16 bytes on all systems, but it was changed to more closely align with the 868252884aeSStefan Eßerminimum allocation size on Linux, which is either 32 bytes (64-bit musl), 24 869252884aeSStefan Eßerbytes (64-bit glibc), 16 bytes (32-bit musl), or 12 bytes (32-bit glibc). Since 870252884aeSStefan Eßerthese are the minimum allocation sizes, these are the sizes that would be 871252884aeSStefan Eßerallocated anyway, making it worth it to just use the whole space, so the value 872252884aeSStefan Eßerof `BC_NUM_DEF_SIZE` on 64-bit systems was changed to 32 bytes. 873252884aeSStefan Eßer 874252884aeSStefan EßerOn top of that, at least on 64-bit, `BC_NUM_DEF_SIZE` supports numbers with 875252884aeSStefan Eßereither 72 integer digits or 45 integer digits and 27 fractional digits. This 876252884aeSStefan Eßershould be more than enough for most cases since `bc`'s default `scale` values 877252884aeSStefan Eßerare 0 or 20, meaning that, by default, it has at most 20 fractional digits. And 878252884aeSStefan Eßer45 integer digits are *a lot*; it's enough to calculate the amount of mass in 879252884aeSStefan Eßerthe Milky Way galaxy in kilograms. Also, 72 digits is enough to calculate the 880252884aeSStefan Eßerdiameter of the universe in Planck lengths. 881252884aeSStefan Eßer 882252884aeSStefan Eßer(For 32-bit, these numbers are either 32 integer digits or 12 integer digits and 883252884aeSStefan Eßer20 fractional digits. These are also quite big, and going much bigger on a 88444d4804dSStefan Eßer32-bit system seems a little pointless since 12 digits is just under a trillion 885252884aeSStefan Eßerand 20 fractional digits is still enough for about any use since `10^-20` light 886252884aeSStefan Eßeryears is just under a millimeter.) 887252884aeSStefan Eßer 888252884aeSStefan EßerAll of this together means that for ordinary uses, and even uses in scientific 889252884aeSStefan Eßerwork, the default number size will be all that is needed, which means that 890252884aeSStefan Eßernearly all, if not all, numbers will be reused, relieving pressure on the system 891252884aeSStefan Eßerallocator. 892252884aeSStefan Eßer 893252884aeSStefan EßerI did several experiments to find the changes that had the most impact, 894252884aeSStefan Eßerespecially with regard to reusing `BcNum`'s. One was putting `BcNum`'s into 895252884aeSStefan Eßerbuckets according to their capacity in powers of 2 up to 512. That performed 896252884aeSStefan Eßerworse than `bc` did in `2.7.2`. Another was putting any `BcNum` on the reuse 897252884aeSStefan Eßerlist that had a capacity of `BC_NUM_DEF_SIZE * 2` and reusing them for `BcNum`'s 898252884aeSStefan Eßerthat requested `BC_NUM_DEF_SIZE`. This did reduce the amount of time spent, but 899252884aeSStefan Eßerit also spent a lot of time in the system allocator for an unknown reason. (When 900252884aeSStefan Eßerusing `strace`, a bunch more `brk` calls showed up.) Just reusing `BcNum`'s that 901252884aeSStefan Eßerhad exactly `BC_NUM_DEF_SIZE` capacity spent the smallest amount of time in both 902252884aeSStefan Eßeruser and system time. This makes sense, especially with the changes to make 903252884aeSStefan Eßer`BC_NUM_DEF_SIZE` bigger on 64-bit systems, since the vast majority of numbers 904252884aeSStefan Eßerwill only ever use numbers with a size less than or equal to `BC_NUM_DEF_SIZE`. 905252884aeSStefan Eßer 906252884aeSStefan EßerLast of all, `bc`'s signal handling underwent a complete redesign. (This is the 907252884aeSStefan Eßerreason that this version is `3.0.0` and not `2.8.0`.) The change was to move 908252884aeSStefan Eßerfrom a polling approach to signal handling to an interrupt-based approach. 909252884aeSStefan Eßer 910252884aeSStefan EßerPreviously, every single loop condition had a check for signals. I suspect that 911252884aeSStefan Eßerthis could be expensive when in tight loops. 912252884aeSStefan Eßer 913252884aeSStefan EßerNow, the signal handler just uses `longjmp()` (actually `siglongjmp()`) to start 914252884aeSStefan Eßeran unwinding of the stack until it is stopped or the stack is unwound to 915252884aeSStefan Eßer`main()`, which just returns. If `bc` is currently executing code that cannot be 916252884aeSStefan Eßersafely interrupted (according to POSIX), then signals are "locked." The signal 917252884aeSStefan Eßerhandler checks if the lock is taken, and if it is, it just sets the status to 918252884aeSStefan Eßerindicate that a signal arrived. Later, when the signal lock is released, the 919252884aeSStefan Eßerstatus is checked to see if a signal came in. If so, the stack unwinding starts. 920252884aeSStefan Eßer 921252884aeSStefan EßerThis design eliminates polling in favor of maintaining a stack of `jmp_buf`'s. 922252884aeSStefan EßerThis has its own performance implications, but it gives better interaction. And 923252884aeSStefan Eßerthe cost of pushing and popping a `jmp_buf` in a function is paid at most twice. 924252884aeSStefan EßerMost functions do not pay that price, and most of the rest only pay it once. 925252884aeSStefan Eßer(There are only some 3 functions in `bc` that push and pop a `jmp_buf` twice.) 926252884aeSStefan Eßer 927252884aeSStefan EßerAs a side effect of this change, I had to eliminate the use of `stdio.h` in `bc` 928252884aeSStefan Eßerbecause `stdio` does not play nice with signals and `longjmp()`. I implemented 929252884aeSStefan Eßercustom I/O buffer code that takes a fraction of the size. This means that static 930252884aeSStefan Eßerbuilds will be smaller, but non-static builds will be bigger, though they will 931252884aeSStefan Eßerhave less linking time. 932252884aeSStefan Eßer 933252884aeSStefan EßerThis change is also good because my history implementation was already bypassing 934252884aeSStefan Eßer`stdio` for good reasons, and unifying the architecture was a win. 935252884aeSStefan Eßer 936252884aeSStefan EßerAnother reason for this change is that my `bc` should *always* behave correctly 937252884aeSStefan Eßerin the presence of signals like `SIGINT`, `SIGTERM`, and `SIGQUIT`. With the 938252884aeSStefan Eßeraddition of my own I/O buffering, I needed to also make sure that the buffers 939252884aeSStefan Eßerwere correctly flushed even when such signals happened. 940252884aeSStefan Eßer 941252884aeSStefan EßerFor this reason, I **removed the option to build without signal support**. 942252884aeSStefan Eßer 943252884aeSStefan EßerAs a nice side effect of this change, the error handling code could be changed 944252884aeSStefan Eßerto take advantage of the stack unwinding that signals used. This means that 945252884aeSStefan Eßersignals and error handling use the same code paths, which means that the stack 946252884aeSStefan Eßerunwinding is well-tested. (Errors are tested heavily in the test suite.) 947252884aeSStefan Eßer 948252884aeSStefan EßerIt also means that functions do not need to return a status code that 949252884aeSStefan Eßer***every*** caller needs to check. This eliminated over 100 branches that simply 950252884aeSStefan Eßerchecked return codes and then passed that return code up the stack if necessary. 951252884aeSStefan EßerThe code bloat savings from this is at least 1700 bytes on `x86_64`, *before* 952252884aeSStefan Eßertaking into account the extra code from removing `stdio.h`. 953252884aeSStefan Eßer 954252884aeSStefan Eßer## 2.7.2 955252884aeSStefan Eßer 956252884aeSStefan EßerThis is a production release with one major bug fix. 957252884aeSStefan Eßer 958252884aeSStefan EßerThe `length()` built-in function can take either a number or an array. If it 959252884aeSStefan Eßertakes an array, it returns the length of the array. Arrays can be passed by 960252884aeSStefan Eßerreference. The bug is that the `length()` function would not properly 961252884aeSStefan Eßerdereference arrays that were references. This is a bug that affects all users. 962252884aeSStefan Eßer 963252884aeSStefan Eßer**ALL USERS SHOULD UPDATE `bc`**. 964252884aeSStefan Eßer 965252884aeSStefan Eßer## 2.7.1 966252884aeSStefan Eßer 967252884aeSStefan EßerThis is a production release with fixes for new locales and fixes for compiler 968252884aeSStefan Eßerwarnings on FreeBSD. 969252884aeSStefan Eßer 970252884aeSStefan Eßer## 2.7.0 971252884aeSStefan Eßer 972252884aeSStefan EßerThis is a production release with a bug fix for Linux, new translations, and new 973252884aeSStefan Eßerfeatures. 974252884aeSStefan Eßer 975252884aeSStefan EßerBug fixes: 976252884aeSStefan Eßer 977252884aeSStefan Eßer* Option parsing in `BC_ENV_ARGS` was broken on Linux in 2.6.1 because `glibc`'s 978252884aeSStefan Eßer `getopt_long()` is broken. To get around that, and to support long options on 979252884aeSStefan Eßer every platform, an adapted version of [`optparse`][17] was added. Now, `bc` 980252884aeSStefan Eßer does not even use `getopt()`. 981252884aeSStefan Eßer* Parsing `BC_ENV_ARGS` with quotes now works. It isn't the smartest, but it 982252884aeSStefan Eßer does the job if there are spaces in file names. 983252884aeSStefan Eßer 984252884aeSStefan EßerThe following new languages are supported: 985252884aeSStefan Eßer 986252884aeSStefan Eßer* Dutch 987252884aeSStefan Eßer* Polish 988252884aeSStefan Eßer* Russian 989252884aeSStefan Eßer* Japanes 990252884aeSStefan Eßer* Simplified Chinese 991252884aeSStefan Eßer 992252884aeSStefan EßerAll of these translations were generated using [DeepL][18], so improvements are 993252884aeSStefan Eßerwelcome. 994252884aeSStefan Eßer 995252884aeSStefan EßerThere is only one new feature: **`bc` now has a built-in pseudo-random number 996252884aeSStefan Eßergenerator** (PRNG). 997252884aeSStefan Eßer 998252884aeSStefan EßerThe PRNG is seeded, making it useful for applications where 999252884aeSStefan Eßer`/dev/urandom` does not work because output needs to be reproducible. However, 1000252884aeSStefan Eßerit also uses `/dev/urandom` to seed itself by default, so it will start with a 1001252884aeSStefan Eßergood seed by default. 1002252884aeSStefan Eßer 1003252884aeSStefan EßerIt also outputs 32 bits on 32-bit platforms and 64 bits on 64-bit platforms, far 1004252884aeSStefan Eßerbetter than the 15 bits of C's `rand()` and `bash`'s `$RANDOM`. 1005252884aeSStefan Eßer 1006252884aeSStefan EßerIn addition, the PRNG can take a bound, and when it gets a bound, it 1007252884aeSStefan Eßerautomatically adjusts to remove bias. It can also generate numbers of arbitrary 1008252884aeSStefan Eßersize. (As of the time of release, the largest pseudo-random number generated by 1009252884aeSStefan Eßerthis `bc` was generated with a bound of `2^(2^20)`.) 1010252884aeSStefan Eßer 1011252884aeSStefan Eßer***IMPORTANT: read the [`bc` manual][9] and the [`dc` manual][10] to find out 1012252884aeSStefan Eßerexactly what guarantees the PRNG provides. The underlying implementation is not 1013252884aeSStefan Eßerguaranteed to stay the same, but the guarantees that it provides are guaranteed 1014252884aeSStefan Eßerto stay the same regardless of the implementation.*** 1015252884aeSStefan Eßer 1016252884aeSStefan EßerOn top of that, four functions were added to `bc`'s [extended math library][16] 1017252884aeSStefan Eßerto make using the PRNG easier: 1018252884aeSStefan Eßer 1019252884aeSStefan Eßer* `frand(p)`: Generates a number between `[0,1)` to `p` decimal places. 1020252884aeSStefan Eßer* `ifrand(i, p)`: Generates an integer with bound `i` and adds it to `frand(p)`. 1021252884aeSStefan Eßer* `srand(x)`: Randomizes the sign of `x`. In other words, it flips the sign of 1022252884aeSStefan Eßer `x` with probability `0.5`. 1023252884aeSStefan Eßer* `brand()`: Returns a random boolean value (either `0` or `1`). 1024252884aeSStefan Eßer 1025252884aeSStefan Eßer## 2.6.1 1026252884aeSStefan Eßer 1027252884aeSStefan EßerThis is a production release with a bug fix for FreeBSD. 1028252884aeSStefan Eßer 1029252884aeSStefan EßerThe bug was that when `bc` was built without long options, it would give a fatal 1030252884aeSStefan Eßererror on every run. This was caused by a mishandling of `optind`. 1031252884aeSStefan Eßer 1032252884aeSStefan Eßer## 2.6.0 1033252884aeSStefan Eßer 1034252884aeSStefan EßerThis release is a production release ***with no bugfixes***. If you do not want 1035252884aeSStefan Eßerto upgrade, you don't have to. 1036252884aeSStefan Eßer 1037252884aeSStefan EßerNo source code changed; the only thing that changed was `lib2.bc`. 1038252884aeSStefan Eßer 1039252884aeSStefan EßerThis release adds one function to the [extended math library][16]: `p(x, y)`, 1040252884aeSStefan Eßerwhich calculates `x` to the power of `y`, whether or not `y` is an integer. (The 1041252884aeSStefan Eßer`^` operator can only accept integer powers.) 1042252884aeSStefan Eßer 1043252884aeSStefan EßerThis release also includes a couple of small tweaks to the [extended math 1044252884aeSStefan Eßerlibrary][16], mostly to fix returning numbers with too high of `scale`. 1045252884aeSStefan Eßer 1046252884aeSStefan Eßer## 2.5.3 1047252884aeSStefan Eßer 1048252884aeSStefan EßerThis release is a production release which addresses inconsistencies in the 1049252884aeSStefan EßerPortuguese locales. No `bc` code was changed. 1050252884aeSStefan Eßer 1051252884aeSStefan EßerThe issues were that the ISO files used different naming, and also that the 1052252884aeSStefan Eßerfiles that should have been symlinks were not. I did not catch that because 1053252884aeSStefan EßerGitHub rendered them the exact same way. 1054252884aeSStefan Eßer 1055252884aeSStefan Eßer## 2.5.2 1056252884aeSStefan Eßer 1057252884aeSStefan EßerThis release is a production release. 1058252884aeSStefan Eßer 1059252884aeSStefan EßerNo code was changed, but the build system was changed to allow `CFLAGS` to be 1060252884aeSStefan Eßergiven to `CC`, like this: 1061252884aeSStefan Eßer 1062252884aeSStefan Eßer``` 1063252884aeSStefan EßerCC="gcc -O3 -march=native" ./configure.sh 1064252884aeSStefan Eßer``` 1065252884aeSStefan Eßer 1066252884aeSStefan EßerIf this happens, the flags are automatically put into `CFLAGS`, and the compiler 1067252884aeSStefan Eßeris set appropriately. In the example above this means that `CC` will be "gcc" 1068252884aeSStefan Eßerand `CFLAGS` will be "-O3 -march=native". 1069252884aeSStefan Eßer 1070252884aeSStefan EßerThis behavior was added to conform to GNU autotools practices. 1071252884aeSStefan Eßer 1072252884aeSStefan Eßer## 2.5.1 1073252884aeSStefan Eßer 1074252884aeSStefan EßerThis is a production release which addresses portability concerns discovered 1075252884aeSStefan Eßerin the `bc` build system. No `bc` code was changed. 1076252884aeSStefan Eßer 1077252884aeSStefan Eßer* Support for Solaris SPARC and AIX were added. 1078252884aeSStefan Eßer* Minor documentations edits were performed. 1079252884aeSStefan Eßer* An option for `configure.sh` was added to disable long options if 1080252884aeSStefan Eßer `getopt_long()` is missing. 1081252884aeSStefan Eßer 1082252884aeSStefan Eßer## 2.5.0 1083252884aeSStefan Eßer 1084252884aeSStefan EßerThis is a production release with new translations. No code changed. 1085252884aeSStefan Eßer 1086252884aeSStefan EßerThe translations were contributed by [bugcrazy][15], and they are for 1087252884aeSStefan EßerPortuguese, both Portugal and Brazil locales. 1088252884aeSStefan Eßer 1089252884aeSStefan Eßer## 2.4.0 1090252884aeSStefan Eßer 1091252884aeSStefan EßerThis is a production release primarily aimed at improving `dc`. 1092252884aeSStefan Eßer 1093252884aeSStefan Eßer* A couple of copy and paste errors in the [`dc` manual][10] were fixed. 1094252884aeSStefan Eßer* `dc` startup was optimized by making sure it didn't have to set up `bc`-only 1095252884aeSStefan Eßer things. 1096252884aeSStefan Eßer* The `bc` `&&` and `||` operators were made available to `dc` through the `M` 1097252884aeSStefan Eßer and `m` commands, respectively. 1098252884aeSStefan Eßer* `dc` macros were changed to be tail call-optimized. 1099252884aeSStefan Eßer 1100252884aeSStefan EßerThe last item, tail call optimization, means that if the last thing in a macro 1101252884aeSStefan Eßeris a call to another macro, then the old macro is popped before executing the 1102252884aeSStefan Eßernew macro. This change was made to stop `dc` from consuming more and more memory 1103252884aeSStefan Eßeras macros are executed in a loop. 1104252884aeSStefan Eßer 1105252884aeSStefan EßerThe `q` and `Q` commands still respect the "hidden" macros by way of recording 1106252884aeSStefan Eßerhow many macros were removed by tail call optimization. 1107252884aeSStefan Eßer 1108252884aeSStefan Eßer## 2.3.2 1109252884aeSStefan Eßer 1110252884aeSStefan EßerThis is a production release meant to fix warnings in the Gentoo `ebuild` by 1111252884aeSStefan Eßermaking it possible to disable binary stripping. Other users do *not* need to 1112252884aeSStefan Eßerupgrade. 1113252884aeSStefan Eßer 1114252884aeSStefan Eßer## 2.3.1 1115252884aeSStefan Eßer 1116252884aeSStefan EßerThis is a production release. It fixes a bug that caused `-1000000000 < -1` to 1117252884aeSStefan Eßerreturn `0`. This only happened with negative numbers and only if the value on 1118252884aeSStefan Eßerthe left was more negative by a certain amount. That said, this bug *is* a bad 1119252884aeSStefan Eßerbug, and needs to be fixed. 1120252884aeSStefan Eßer 1121252884aeSStefan Eßer**ALL USERS SHOULD UPDATE `bc`**. 1122252884aeSStefan Eßer 1123252884aeSStefan Eßer## 2.3.0 1124252884aeSStefan Eßer 1125252884aeSStefan EßerThis is a production release with changes to the build system. 1126252884aeSStefan Eßer 1127252884aeSStefan Eßer## 2.2.0 1128252884aeSStefan Eßer 1129252884aeSStefan EßerThis release is a production release. It only has new features and performance 1130252884aeSStefan Eßerimprovements. 1131252884aeSStefan Eßer 1132252884aeSStefan Eßer1. The performance of `sqrt(x)` was improved. 1133252884aeSStefan Eßer2. The new function `root(x, n)` was added to the extended math library to 1134252884aeSStefan Eßer calculate `n`th roots. 1135252884aeSStefan Eßer3. The new function `cbrt(x)` was added to the extended math library to 1136252884aeSStefan Eßer calculate cube roots. 1137252884aeSStefan Eßer 1138252884aeSStefan Eßer## 2.1.3 1139252884aeSStefan Eßer 1140252884aeSStefan EßerThis is a non-critical release; it just changes the build system, and in 1141252884aeSStefan Eßernon-breaking ways: 1142252884aeSStefan Eßer 1143252884aeSStefan Eßer1. Linked locale files were changed to link to their sources with a relative 1144252884aeSStefan Eßer link. 1145252884aeSStefan Eßer2. A bug in `configure.sh` that caused long option parsing to fail under `bash` 1146252884aeSStefan Eßer was fixed. 1147252884aeSStefan Eßer 1148252884aeSStefan Eßer## 2.1.2 1149252884aeSStefan Eßer 1150252884aeSStefan EßerThis release is not a critical release. 1151252884aeSStefan Eßer 1152252884aeSStefan Eßer1. A few codes were added to history. 1153252884aeSStefan Eßer2. Multiplication was optimized a bit more. 1154252884aeSStefan Eßer3. Addition and subtraction were both optimized a bit more. 1155252884aeSStefan Eßer 1156252884aeSStefan Eßer## 2.1.1 1157252884aeSStefan Eßer 1158252884aeSStefan EßerThis release contains a fix for the test suite made for Linux from Scratch: now 1159252884aeSStefan Eßerthe test suite prints `pass` when a test is passed. 1160252884aeSStefan Eßer 1161252884aeSStefan EßerOther than that, there is no change in this release, so distros and other users 1162252884aeSStefan Eßerdo not need to upgrade. 1163252884aeSStefan Eßer 1164252884aeSStefan Eßer## 2.1.0 1165252884aeSStefan Eßer 1166252884aeSStefan EßerThis release is a production release. 1167252884aeSStefan Eßer 1168252884aeSStefan EßerThe following bugs were fixed: 1169252884aeSStefan Eßer 1170252884aeSStefan Eßer1. A `dc` bug that caused stack mishandling was fixed. 1171252884aeSStefan Eßer2. A warning on OpenBSD was fixed. 1172252884aeSStefan Eßer3. Bugs in `ctrl+arrow` operations in history were fixed. 1173252884aeSStefan Eßer4. The ability to paste multiple lines in history was added. 1174252884aeSStefan Eßer5. A `bc` bug, mishandling of array arguments to functions, was fixed. 1175252884aeSStefan Eßer6. A crash caused by freeing the wrong pointer was fixed. 1176252884aeSStefan Eßer7. A `dc` bug where strings, in a rare case, were mishandled in parsing was 1177252884aeSStefan Eßer fixed. 1178252884aeSStefan Eßer 1179252884aeSStefan EßerIn addition, the following changes were made: 1180252884aeSStefan Eßer 1181252884aeSStefan Eßer1. Division was slightly optimized. 1182252884aeSStefan Eßer2. An option was added to the build to disable printing of prompts. 1183252884aeSStefan Eßer3. The special case of empty arguments is now handled. This is to prevent 1184252884aeSStefan Eßer errors in scripts that end up passing empty arguments. 1185252884aeSStefan Eßer4. A harmless bug was fixed. This bug was that, with the pop instructions 1186252884aeSStefan Eßer (mostly) removed (see below), `bc` would leave extra values on its stack for 1187252884aeSStefan Eßer `void` functions and in a few other cases. These extra items would not 1188252884aeSStefan Eßer affect anything put on the stack and would not cause any sort of crash or 1189252884aeSStefan Eßer even buggy behavior, but they would cause `bc` to take more memory than it 1190252884aeSStefan Eßer needed. 1191252884aeSStefan Eßer 1192252884aeSStefan EßerOn top of the above changes, the following optimizations were added: 1193252884aeSStefan Eßer 1194252884aeSStefan Eßer1. The need for pop instructions in `bc` was removed. 1195252884aeSStefan Eßer2. Extra tests on every iteration of the interpreter loop were removed. 1196252884aeSStefan Eßer3. Updating function and code pointers on every iteration of the interpreter 1197252884aeSStefan Eßer loop was changed to only updating them when necessary. 1198252884aeSStefan Eßer4. Extra assignments to pointers were removed. 1199252884aeSStefan Eßer 1200252884aeSStefan EßerAltogether, these changes sped up the interpreter by around 2x. 1201252884aeSStefan Eßer 1202252884aeSStefan Eßer***NOTE***: This is the last release with new features because this `bc` is now 1203252884aeSStefan Eßerconsidered complete. From now on, only bug fixes and new translations will be 1204252884aeSStefan Eßeradded to this `bc`. 1205252884aeSStefan Eßer 1206252884aeSStefan Eßer## 2.0.3 1207252884aeSStefan Eßer 1208252884aeSStefan EßerThis is a production, bug-fix release. 1209252884aeSStefan Eßer 1210252884aeSStefan EßerTwo bugs were fixed in this release: 1211252884aeSStefan Eßer 1212252884aeSStefan Eßer1. A rare and subtle signal handling bug was fixed. 1213252884aeSStefan Eßer2. A misbehavior on `0` to a negative power was fixed. 1214252884aeSStefan Eßer 1215252884aeSStefan EßerThe last bug bears some mentioning. 1216252884aeSStefan Eßer 1217252884aeSStefan EßerWhen I originally wrote power, I did not thoroughly check its error cases; 1218252884aeSStefan Eßerinstead, I had it check if the first number was `0` and then if so, just return 1219252884aeSStefan Eßer`0`. However, `0` to a negative power means that `1` will be divided by `0`, 1220252884aeSStefan Eßerwhich is an error. 1221252884aeSStefan Eßer 1222252884aeSStefan EßerI caught this, but only after I stopped being cocky. You see, sometime later, I 1223252884aeSStefan Eßerhad noticed that GNU `bc` returned an error, correctly, but I thought it was 1224252884aeSStefan Eßerwrong simply because that's not what my `bc` did. I saw it again later and had a 1225252884aeSStefan Eßerdouble take. I checked for real, finally, and found out that my `bc` was wrong 1226252884aeSStefan Eßerall along. 1227252884aeSStefan Eßer 1228252884aeSStefan EßerThat was bad on me. But the bug was easy to fix, so it is fixed now. 1229252884aeSStefan Eßer 1230252884aeSStefan EßerThere are two other things in this release: 1231252884aeSStefan Eßer 1232252884aeSStefan Eßer1. Subtraction was optimized by [Stefan Eßer][14]. 1233252884aeSStefan Eßer2. Division was also optimized, also by Stefan Eßer. 1234252884aeSStefan Eßer 1235252884aeSStefan Eßer## 2.0.2 1236252884aeSStefan Eßer 1237252884aeSStefan EßerThis release contains a fix for a possible overflow in the signal handling. I 1238252884aeSStefan Eßerwould be surprised if any users ran into it because it would only happen after 2 1239252884aeSStefan Eßerbillion (`2^31-1`) `SIGINT`'s, but I saw it and had to fix it. 1240252884aeSStefan Eßer 1241252884aeSStefan Eßer## 2.0.1 1242252884aeSStefan Eßer 1243252884aeSStefan EßerThis release contains very few things that will apply to any users. 1244252884aeSStefan Eßer 1245252884aeSStefan Eßer1. A slight bug in `dc`'s interactive mode was fixed. 1246252884aeSStefan Eßer2. A bug in the test suite that was only triggered on NetBSD was fixed. 1247252884aeSStefan Eßer3. **The `-P`/`--no-prompt` option** was added for users that do not want a 1248252884aeSStefan Eßer prompt. 1249252884aeSStefan Eßer4. A `make check` target was added as an alias for `make test`. 1250252884aeSStefan Eßer5. `dc` got its own read prompt: `?> `. 1251252884aeSStefan Eßer 1252252884aeSStefan Eßer## 2.0.0 1253252884aeSStefan Eßer 1254252884aeSStefan EßerThis release is a production release. 1255252884aeSStefan Eßer 1256252884aeSStefan EßerThis release is also a little different from previous releases. From here on 1257252884aeSStefan Eßerout, I do not plan on adding any more features to this `bc`; I believe that it 1258252884aeSStefan Eßeris complete. However, there may be bug fix releases in the future, if I or any 1259252884aeSStefan Eßerothers manage to find bugs. 1260252884aeSStefan Eßer 1261252884aeSStefan EßerThis release has only a few new features: 1262252884aeSStefan Eßer 1263252884aeSStefan Eßer1. `atan2(y, x)` was added to the extended math library as both `a2(y, x)` and 1264252884aeSStefan Eßer `atan2(y, x)`. 1265252884aeSStefan Eßer2. Locales were fixed. 1266252884aeSStefan Eßer3. A **POSIX shell-compatible script was added as an alternative to compiling 1267252884aeSStefan Eßer `gen/strgen.c`** on a host machine. More details about making the choice 1268252884aeSStefan Eßer between the two can be found by running `./configure.sh --help` or reading 1269252884aeSStefan Eßer the [build manual][13]. 1270252884aeSStefan Eßer4. Multiplication was optimized by using **diagonal multiplication**, rather 1271252884aeSStefan Eßer than straight brute force. 1272252884aeSStefan Eßer5. The `locale_install.sh` script was fixed. 1273252884aeSStefan Eßer6. `dc` was given the ability to **use the environment variable 1274252884aeSStefan Eßer `DC_ENV_ARGS`**. 1275252884aeSStefan Eßer7. `dc` was also given the ability to **use the `-i` or `--interactive`** 1276252884aeSStefan Eßer options. 1277252884aeSStefan Eßer8. Printing the prompt was fixed so that it did not print when it shouldn't. 1278252884aeSStefan Eßer9. Signal handling was fixed. 1279252884aeSStefan Eßer10. **Handling of `SIGTERM` and `SIGQUIT`** was fixed. 1280252884aeSStefan Eßer11. The **built-in functions `maxibase()`, `maxobase()`, and `maxscale()`** (the 1281252884aeSStefan Eßer commands `T`, `U`, `V` in `dc`, respectively) were added to allow scripts to 1282252884aeSStefan Eßer query for the max allowable values of those globals. 1283252884aeSStefan Eßer12. Some incompatibilities with POSIX were fixed. 1284252884aeSStefan Eßer 1285252884aeSStefan EßerIn addition, this release is `2.0.0` for a big reason: the internal format for 1286252884aeSStefan Eßernumbers changed. They used to be a `char` array. Now, they are an array of 1287252884aeSStefan Eßerlarger integers, packing more decimal digits into each integer. This has 1288252884aeSStefan Eßerdelivered ***HUGE*** performance improvements, especially for multiplication, 1289252884aeSStefan Eßerdivision, and power. 1290252884aeSStefan Eßer 1291252884aeSStefan EßerThis `bc` should now be the fastest `bc` available, but I may be wrong. 1292252884aeSStefan Eßer 1293252884aeSStefan Eßer## 1.2.8 1294252884aeSStefan Eßer 1295252884aeSStefan EßerThis release contains a fix for a harmless bug (it is harmless in that it still 1296252884aeSStefan Eßerworks, but it just copies extra data) in the [`locale_install.sh`][12] script. 1297252884aeSStefan Eßer 1298252884aeSStefan Eßer## 1.2.7 1299252884aeSStefan Eßer 1300252884aeSStefan EßerThis version contains fixes for the build on Arch Linux. 1301252884aeSStefan Eßer 1302252884aeSStefan Eßer## 1.2.6 1303252884aeSStefan Eßer 1304252884aeSStefan EßerThis release removes the use of `local` in shell scripts because it's not POSIX 1305252884aeSStefan Eßershell-compatible, and also updates a man page that should have been updated a 1306252884aeSStefan Eßerlong time ago but was missed. 1307252884aeSStefan Eßer 1308252884aeSStefan Eßer## 1.2.5 1309252884aeSStefan Eßer 1310252884aeSStefan EßerThis release contains some missing locale `*.msg` files. 1311252884aeSStefan Eßer 1312252884aeSStefan Eßer## 1.2.4 1313252884aeSStefan Eßer 1314252884aeSStefan EßerThis release contains a few bug fixes and new French translations. 1315252884aeSStefan Eßer 1316252884aeSStefan Eßer## 1.2.3 1317252884aeSStefan Eßer 1318252884aeSStefan EßerThis release contains a fix for a bug: use of uninitialized data. Such data was 1319252884aeSStefan Eßeronly used when outputting an error message, but I am striving for perfection. As 1320252884aeSStefan EßerMichelangelo said, "Trifles make perfection, and perfection is no trifle." 1321252884aeSStefan Eßer 1322252884aeSStefan Eßer## 1.2.2 1323252884aeSStefan Eßer 1324252884aeSStefan EßerThis release contains fixes for OpenBSD. 1325252884aeSStefan Eßer 1326252884aeSStefan Eßer## 1.2.1 1327252884aeSStefan Eßer 1328252884aeSStefan EßerThis release contains bug fixes for some rare bugs. 1329252884aeSStefan Eßer 1330252884aeSStefan Eßer## 1.2.0 1331252884aeSStefan Eßer 1332252884aeSStefan EßerThis is a production release. 1333252884aeSStefan Eßer 1334252884aeSStefan EßerThere have been several changes since `1.1.0`: 1335252884aeSStefan Eßer 1336252884aeSStefan Eßer1. The build system had some changes. 1337252884aeSStefan Eßer2. Locale support has been added. (Patches welcome for translations.) 1338252884aeSStefan Eßer3. **The ability to turn `ibase`, `obase`, and `scale` into stacks** was added 1339252884aeSStefan Eßer with the `-g` command-line option. (See the [`bc` manual][9] for more 1340252884aeSStefan Eßer details.) 1341252884aeSStefan Eßer4. Support for compiling on Mac OSX out of the box was added. 1342252884aeSStefan Eßer5. The extended math library got `t(x)`, `ceil(x)`, and some aliases. 1343252884aeSStefan Eßer6. The extended math library also got `r2d(x)` (for converting from radians to 1344252884aeSStefan Eßer degrees) and `d2r(x)` (for converting from degrees to radians). This is to 1345252884aeSStefan Eßer allow using degrees with the standard library. 1346252884aeSStefan Eßer7. Both calculators now accept numbers in **scientific notation**. See the 1347252884aeSStefan Eßer [`bc` manual][9] and the [`dc` manual][10] for details. 1348252884aeSStefan Eßer8. Both calculators can **output in either scientific or engineering 1349252884aeSStefan Eßer notation**. See the [`bc` manual][9] and the [`dc` manual][10] for details. 1350252884aeSStefan Eßer9. Some inefficiencies were removed. 1351252884aeSStefan Eßer10. Some bugs were fixed. 1352252884aeSStefan Eßer11. Some bugs in the extended library were fixed. 1353252884aeSStefan Eßer12. Some defects from [Coverity Scan][11] were fixed. 1354252884aeSStefan Eßer 1355252884aeSStefan Eßer## 1.1.4 1356252884aeSStefan Eßer 1357252884aeSStefan EßerThis release contains a fix to the build system that allows it to build on older 1358252884aeSStefan Eßerversions of `glibc`. 1359252884aeSStefan Eßer 1360252884aeSStefan Eßer## 1.1.3 1361252884aeSStefan Eßer 1362252884aeSStefan EßerThis release contains a fix for a bug in the test suite where `bc` tests and 1363252884aeSStefan Eßer`dc` tests could not be run in parallel. 1364252884aeSStefan Eßer 1365252884aeSStefan Eßer## 1.1.2 1366252884aeSStefan Eßer 1367252884aeSStefan EßerThis release has a fix for a history bug; the down arrow did not work. 1368252884aeSStefan Eßer 1369252884aeSStefan Eßer## 1.1.1 1370252884aeSStefan Eßer 1371252884aeSStefan EßerThis release fixes a bug in the `1.1.0` build system. The source is exactly the 1372252884aeSStefan Eßersame. 1373252884aeSStefan Eßer 1374252884aeSStefan EßerThe bug that was fixed was a failure to install if no `EXECSUFFIX` was used. 1375252884aeSStefan Eßer 1376252884aeSStefan Eßer## 1.1.0 1377252884aeSStefan Eßer 1378252884aeSStefan EßerThis is a production release. However, many new features were added since `1.0`. 1379252884aeSStefan Eßer 1380252884aeSStefan Eßer1. **The build system has been changed** to use a custom, POSIX 1381252884aeSStefan Eßer shell-compatible configure script ([`configure.sh`][6]) to generate a POSIX 1382252884aeSStefan Eßer make-compatible `Makefile`, which means that `bc` and `dc` now build out of 1383252884aeSStefan Eßer the box on any POSIX-compatible system. 1384252884aeSStefan Eßer2. Out-of-memory and output errors now cause the `bc` to report the error, 1385252884aeSStefan Eßer clean up, and die, rather than just reporting and trying to continue. 1386252884aeSStefan Eßer3. **Strings and constants are now garbage collected** when possible. 1387252884aeSStefan Eßer4. Signal handling and checking has been made more simple and more thorough. 1388252884aeSStefan Eßer5. `BcGlobals` was refactored into `BcVm` and `BcVm` was made global. Some 1389252884aeSStefan Eßer procedure names were changed to reflect its difference to everything else. 1390252884aeSStefan Eßer6. Addition got a speed improvement. 1391252884aeSStefan Eßer7. Some common code for addition and multiplication was refactored into its own 1392252884aeSStefan Eßer procedure. 1393252884aeSStefan Eßer8. A bug was removed where `dc` could have been selected, but the internal 1394252884aeSStefan Eßer `#define` that returned `true` for a query about `dc` would not have 1395252884aeSStefan Eßer returned `true`. 1396252884aeSStefan Eßer9. Useless calls to `bc_num_zero()` were removed. 1397252884aeSStefan Eßer10. **History support was added.** The history support is based off of a 1398252884aeSStefan Eßer [UTF-8 aware fork][7] of [`linenoise`][8], which has been customized with 1399252884aeSStefan Eßer `bc`'s own data structures and signal handling. 1400252884aeSStefan Eßer11. Generating C source from the math library now removes tabs from the library, 1401252884aeSStefan Eßer shrinking the size of the executable. 1402252884aeSStefan Eßer12. The math library was shrunk. 1403252884aeSStefan Eßer13. Error handling and reporting was improved. 1404252884aeSStefan Eßer14. Reallocations were reduced by giving access to the request size for each 1405252884aeSStefan Eßer operation. 1406252884aeSStefan Eßer15. **`abs()` (`b` command for `dc`) was added as a builtin.** 1407252884aeSStefan Eßer16. Both calculators were tested on FreeBSD. 1408252884aeSStefan Eßer17. Many obscure parse bugs were fixed. 1409252884aeSStefan Eßer18. Markdown and man page manuals were added, and the man pages are installed by 1410252884aeSStefan Eßer `make install`. 1411252884aeSStefan Eßer19. Executable size was reduced, though the added features probably made the 1412252884aeSStefan Eßer executable end up bigger. 1413252884aeSStefan Eßer20. **GNU-style array references were added as a supported feature.** 1414252884aeSStefan Eßer21. Allocations were reduced. 1415252884aeSStefan Eßer22. **New operators were added**: `$` (`$` for `dc`), `@` (`@` for `dc`), `@=`, 1416252884aeSStefan Eßer `<<` (`H` for `dc`), `<<=`, `>>` (`h` for `dc`), and `>>=`. See the 1417252884aeSStefan Eßer [`bc` manual][9] and the [`dc` manual][10] for more details. 1418252884aeSStefan Eßer23. **An extended math library was added.** This library contains code that 1419252884aeSStefan Eßer makes it so I can replace my desktop calculator with this `bc`. See the 1420252884aeSStefan Eßer [`bc` manual][3] for more details. 1421252884aeSStefan Eßer24. Support for all capital letters as numbers was added. 1422252884aeSStefan Eßer25. **Support for GNU-style void functions was added.** 1423252884aeSStefan Eßer26. A bug fix for improper handling of function parameters was added. 1424252884aeSStefan Eßer27. Precedence for the or (`||`) operator was changed to match GNU `bc`. 1425252884aeSStefan Eßer28. `dc` was given an explicit negation command. 1426252884aeSStefan Eßer29. `dc` was changed to be able to handle strings in arrays. 1427252884aeSStefan Eßer 1428252884aeSStefan Eßer## 1.1 Release Candidate 3 1429252884aeSStefan Eßer 1430252884aeSStefan EßerThis release is the eighth release candidate for 1.1, though it is the third 1431252884aeSStefan Eßerrelease candidate meant as a general release candidate. The new code has not 1432252884aeSStefan Eßerbeen tested as thoroughly as it should for release. 1433252884aeSStefan Eßer 1434252884aeSStefan Eßer## 1.1 Release Candidate 2 1435252884aeSStefan Eßer 1436252884aeSStefan EßerThis release is the seventh release candidate for 1.1, though it is the second 1437252884aeSStefan Eßerrelease candidate meant as a general release candidate. The new code has not 1438252884aeSStefan Eßerbeen tested as thoroughly as it should for release. 1439252884aeSStefan Eßer 1440252884aeSStefan Eßer## 1.1 FreeBSD Beta 5 1441252884aeSStefan Eßer 1442252884aeSStefan EßerThis release is the sixth release candidate for 1.1, though it is the fifth 1443252884aeSStefan Eßerrelease candidate meant specifically to test if `bc` works on FreeBSD. The new 1444252884aeSStefan Eßercode has not been tested as thoroughly as it should for release. 1445252884aeSStefan Eßer 1446252884aeSStefan Eßer## 1.1 FreeBSD Beta 4 1447252884aeSStefan Eßer 1448252884aeSStefan EßerThis release is the fifth release candidate for 1.1, though it is the fourth 1449252884aeSStefan Eßerrelease candidate meant specifically to test if `bc` works on FreeBSD. The new 1450252884aeSStefan Eßercode has not been tested as thoroughly as it should for release. 1451252884aeSStefan Eßer 1452252884aeSStefan Eßer## 1.1 FreeBSD Beta 3 1453252884aeSStefan Eßer 1454252884aeSStefan EßerThis release is the fourth release candidate for 1.1, though it is the third 1455252884aeSStefan Eßerrelease candidate meant specifically to test if `bc` works on FreeBSD. The new 1456252884aeSStefan Eßercode has not been tested as thoroughly as it should for release. 1457252884aeSStefan Eßer 1458252884aeSStefan Eßer## 1.1 FreeBSD Beta 2 1459252884aeSStefan Eßer 1460252884aeSStefan EßerThis release is the third release candidate for 1.1, though it is the second 1461252884aeSStefan Eßerrelease candidate meant specifically to test if `bc` works on FreeBSD. The new 1462252884aeSStefan Eßercode has not been tested as thoroughly as it should for release. 1463252884aeSStefan Eßer 1464252884aeSStefan Eßer## 1.1 FreeBSD Beta 1 1465252884aeSStefan Eßer 1466252884aeSStefan EßerThis release is the second release candidate for 1.1, though it is meant 1467252884aeSStefan Eßerspecifically to test if `bc` works on FreeBSD. The new code has not been tested as 1468252884aeSStefan Eßerthoroughly as it should for release. 1469252884aeSStefan Eßer 1470252884aeSStefan Eßer## 1.1 Release Candidate 1 1471252884aeSStefan Eßer 1472252884aeSStefan EßerThis is the first release candidate for 1.1. The new code has not been tested as 1473252884aeSStefan Eßerthoroughly as it should for release. 1474252884aeSStefan Eßer 1475252884aeSStefan Eßer## 1.0 1476252884aeSStefan Eßer 1477252884aeSStefan EßerThis is the first non-beta release. `bc` is ready for production use. 1478252884aeSStefan Eßer 1479252884aeSStefan EßerAs such, a lot has changed since 0.5. 1480252884aeSStefan Eßer 1481252884aeSStefan Eßer1. `dc` has been added. It has been tested even more thoroughly than `bc` was 1482252884aeSStefan Eßer for `0.5`. It does not have the `!` command, and for security reasons, it 1483252884aeSStefan Eßer never will, so it is complete. 1484252884aeSStefan Eßer2. `bc` has been more thoroughly tested. An entire section of the test suite 1485252884aeSStefan Eßer (for both programs) has been added to test for errors. 1486252884aeSStefan Eßer3. A prompt (`>>> `) has been added for interactive mode, making it easier to 1487252884aeSStefan Eßer see inputs and outputs. 1488252884aeSStefan Eßer4. Interrupt handling has been improved, including elimination of race 1489252884aeSStefan Eßer conditions (as much as possible). 1490252884aeSStefan Eßer5. MinGW and [Windows Subsystem for Linux][1] support has been added (see 1491252884aeSStefan Eßer [xstatic][2] for binaries). 1492252884aeSStefan Eßer6. Memory leaks and errors have been eliminated (as far as ASan and Valgrind 1493252884aeSStefan Eßer can tell). 1494252884aeSStefan Eßer7. Crashes have been eliminated (as far as [afl][3] can tell). 1495252884aeSStefan Eßer8. Karatsuba multiplication was added (and thoroughly) tested, speeding up 1496252884aeSStefan Eßer multiplication and power by orders of magnitude. 1497252884aeSStefan Eßer9. Performance was further enhanced by using a "divmod" function to reduce 1498252884aeSStefan Eßer redundant divisions and by removing superfluous `memset()` calls. 1499252884aeSStefan Eßer10. To switch between Karatsuba and `O(n^2)` multiplication, the config variable 1500252884aeSStefan Eßer `BC_NUM_KARATSUBA_LEN` was added. It is set to a sane default, but the 1501252884aeSStefan Eßer optimal number can be found with [`karatsuba.py`][4] (requires Python 3) 1502252884aeSStefan Eßer and then configured through `make`. 1503252884aeSStefan Eßer11. The random math test generator script was changed to Python 3 and improved. 1504252884aeSStefan Eßer `bc` and `dc` have together been run through 30+ million random tests. 1505252884aeSStefan Eßer12. All known math bugs have been fixed, including out of control memory 1506252884aeSStefan Eßer allocations in `sine` and `cosine` (that was actually a parse bug), certain 1507252884aeSStefan Eßer cases of infinite loop on square root, and slight inaccuracies (as much as 1508252884aeSStefan Eßer possible; see the [README][5]) in transcendental functions. 1509252884aeSStefan Eßer13. Parsing has been fixed as much as possible. 1510252884aeSStefan Eßer14. Test coverage was improved to 94.8%. The only paths not covered are ones 1511252884aeSStefan Eßer that happen when `malloc()` or `realloc()` fails. 1512252884aeSStefan Eßer15. An extension to get the length of an array was added. 1513252884aeSStefan Eßer16. The boolean not (`!`) had its precedence change to match negation. 1514252884aeSStefan Eßer17. Data input was hardened. 1515252884aeSStefan Eßer18. `bc` was made fully compliant with POSIX when the `-s` flag is used or 1516252884aeSStefan Eßer `POSIXLY_CORRECT` is defined. 1517252884aeSStefan Eßer19. Error handling was improved. 1518252884aeSStefan Eßer20. `bc` now checks that files it is given are not directories. 1519252884aeSStefan Eßer 1520252884aeSStefan Eßer## 1.0 Release Candidate 7 1521252884aeSStefan Eßer 1522252884aeSStefan EßerThis is the seventh release candidate for 1.0. It fixes a few bugs in 1.0 1523252884aeSStefan EßerRelease Candidate 6. 1524252884aeSStefan Eßer 1525252884aeSStefan Eßer## 1.0 Release Candidate 6 1526252884aeSStefan Eßer 1527252884aeSStefan EßerThis is the sixth release candidate for 1.0. It fixes a few bugs in 1.0 Release 1528252884aeSStefan EßerCandidate 5. 1529252884aeSStefan Eßer 1530252884aeSStefan Eßer## 1.0 Release Candidate 5 1531252884aeSStefan Eßer 1532252884aeSStefan EßerThis is the fifth release candidate for 1.0. It fixes a few bugs in 1.0 Release 1533252884aeSStefan EßerCandidate 4. 1534252884aeSStefan Eßer 1535252884aeSStefan Eßer## 1.0 Release Candidate 4 1536252884aeSStefan Eßer 1537252884aeSStefan EßerThis is the fourth release candidate for 1.0. It fixes a few bugs in 1.0 Release 1538252884aeSStefan EßerCandidate 3. 1539252884aeSStefan Eßer 1540252884aeSStefan Eßer## 1.0 Release Candidate 3 1541252884aeSStefan Eßer 1542252884aeSStefan EßerThis is the third release candidate for 1.0. It fixes a few bugs in 1.0 Release 1543252884aeSStefan EßerCandidate 2. 1544252884aeSStefan Eßer 1545252884aeSStefan Eßer## 1.0 Release Candidate 2 1546252884aeSStefan Eßer 1547252884aeSStefan EßerThis is the second release candidate for 1.0. It fixes a few bugs in 1.0 Release 1548252884aeSStefan EßerCandidate 1. 1549252884aeSStefan Eßer 1550252884aeSStefan Eßer## 1.0 Release Candidate 1 1551252884aeSStefan Eßer 1552252884aeSStefan EßerThis is the first Release Candidate for 1.0. `bc` is complete, with `dc`, but it 1553252884aeSStefan Eßeris not tested. 1554252884aeSStefan Eßer 1555252884aeSStefan Eßer## 0.5 1556252884aeSStefan Eßer 1557252884aeSStefan EßerThis beta release completes more features, but it is still not complete nor 1558252884aeSStefan Eßertested as thoroughly as necessary. 1559252884aeSStefan Eßer 1560252884aeSStefan Eßer## 0.4.1 1561252884aeSStefan Eßer 1562252884aeSStefan EßerThis beta release fixes a few bugs in 0.4. 1563252884aeSStefan Eßer 1564252884aeSStefan Eßer## 0.4 1565252884aeSStefan Eßer 1566252884aeSStefan EßerThis is a beta release. It does not have the complete set of features, and it is 1567252884aeSStefan Eßernot thoroughly tested. 1568252884aeSStefan Eßer 1569252884aeSStefan Eßer[1]: https://docs.microsoft.com/en-us/windows/wsl/install-win10 1570252884aeSStefan Eßer[2]: https://pkg.musl.cc/bc/ 1571252884aeSStefan Eßer[3]: http://lcamtuf.coredump.cx/afl/ 157244d4804dSStefan Eßer[4]: ./scripts/karatsuba.py 1573252884aeSStefan Eßer[5]: ./README.md 1574252884aeSStefan Eßer[6]: ./configure.sh 1575252884aeSStefan Eßer[7]: https://github.com/rain-1/linenoise-mob 1576252884aeSStefan Eßer[8]: https://github.com/antirez/linenoise 15773aa99676SStefan Eßer[9]: ./manuals/bc/A.1.md 15783aa99676SStefan Eßer[10]: ./manuals/dc/A.1.md 1579252884aeSStefan Eßer[11]: https://scan.coverity.com/projects/gavinhoward-bc 158044d4804dSStefan Eßer[12]: ./scripts/locale_install.sh 1581252884aeSStefan Eßer[13]: ./manuals/build.md 1582252884aeSStefan Eßer[14]: https://github.com/stesser 1583252884aeSStefan Eßer[15]: https://github.com/bugcrazy 15843aa99676SStefan Eßer[16]: ./manuals/bc/A.1.md#extended-library 1585252884aeSStefan Eßer[17]: https://github.com/skeeto/optparse 1586252884aeSStefan Eßer[18]: https://www.deepl.com/translator 1587252884aeSStefan Eßer[19]: ./manuals/benchmarks.md 15883aa99676SStefan Eßer[20]: https://github.com/apjanke/ronn-ng 15893aa99676SStefan Eßer[21]: https://pandoc.org/ 159044d4804dSStefan Eßer[22]: ./scripts/locale_uninstall.sh 1591