Gavin Howard's bc

From Rosetta Code
Revision as of 21:08, 14 May 2021 by rosettacode>Gavinhoward (Created page with "{{implementation|bc}} This bc was written by Gavinhoward. This bc is default in FreeBSD 13 and 14, and the bc's in toybox and busybox are ba...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Gavin Howard's bc is an implementation of bc. Other implementations of bc.

This bc was written by Gavinhoward.

This bc is default in FreeBSD 13 and 14, and the bc's in toybox and busybox are based on this bc.

These extensions are in OpenBSD bc, but not in POSIX:

  • The -e and f options.
  • Global stacks.
  • # Line comments.
  • Relational operators (== <= >= != < >) in any expression, not only in 'if', 'while', or 'for'.
  • Boolean operators (! && ||).
  • else branch of an 'if' statement.
  • print statement, with escapes like '\n'.
  • Special variable last, also known as . (a single dot).
  • Scientific and engineering notation.
  • A pseudo-random number generator.
  • A way to get user input (read()).

And many more.