Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@gavinhoward gavinhoward released this 25 May 18:00
· 2189 commits to master since this release

This release is a production release.

This release is also a little different from previous releases. From here on out, I do not plan on adding any more features to this bc; I believe that it is complete. However, there may be bug fix releases in the future, if I or any others manage to find bugs.

This release has only a few new features:

  • atan2(y, x) was added to the extended math library as both a2(y, x) and atan2(y, x).
  • Locales were fixed.
  • A POSIX shell-compatible script was added as an alternative to compiling gen/strgen.c on a host machine. More details about making the choice between the two can be found by running ./configure.sh --help or reading the build manual.
  • Multiplication was optimized by using diagonal multiplication, rather than straight brute force.
  • The locale_install.sh script was fixed.
  • dc was given the ability to use the environment variable DC_ENV_ARGS.
  • dc was also given the ability to use the -i or --interactive options.
  • Printing the prompt was fixed so that it did not print when it shouldn't.
  • Signal handling was fixed.
  • Handling of SIGTERM and SIGQUIT was fixed.
  • The built-in functions maxibase(), maxobase(), and maxscale() (the commands T, U, V in dc, respectively) were added to allow scripts to query for the max allowable values of those globals.
  • Some incompatibilities with POSIX were fixed.

In addition, this release is 2.0.0 for a big reason: the internal format for numbers changed. They used to be a char array. Now, they are an array of larger integers, packing more decimal digits into each integer. This has delivered HUGE performance improvements, especially for multiplication, division, and power.

This bc should be the fastest bc available, but I may be wrong.

$ sha512sum bc-2.0.0.tar.xz
183cec17ed5020e673abb886eb1f391f8a97ac37a67ca63bb00d8b4c8e52ba0e502f7f813d5b4abf650b0fd0dc74a7e8a7a752faf8a47bd7a8014fd4703bca05  bc-2.0.0.tar.xz

$ sha256sum bc-2.0.0.tar.xz
0ddfc78f6588d9c4d33334cb6862e6db96b2e499a8a650701e98de745e3f549e  bc-2.0.0.tar.xz

$ stat -c '%s  %n' bc-2.0.0.tar.xz
147196  bc-2.0.0.tar.xz