FAQ 900 B

1234567891011121314151617181920
  1. BCMATH FAQ:
  2. 1) Why BCMATH?
  3. The math routines of GNU bc become more generally useful in a
  4. library form. By separating the BCMATH library from GNU bc,
  5. GNU bc can be under the GPL and BCMATH can be under the LGPL.
  6. 2) Why BCMATH when GMP exists?
  7. GMP has "integers" (no digits after a decimal), "rational numbers"
  8. (stored as 2 integers) and "floats". None of these will correctly
  9. represent a POSIX BC number. Floats are the closest, but will not
  10. behave correctly for many computations. For example, BC numbers have
  11. a "scale" that represent the number of digits to represent after the
  12. decimal point. The multiplying two of these numbers requires one to
  13. calculate an exact number of digits after the decimal point regardless
  14. of the number of digits in the integer part. GMP floats have a
  15. "fixed, but arbitrary" mantissa and so multiplying two floats will end
  16. up dropping digits BC must calculate.