Re: Number types in Lisp



On May 23, 6:22 am, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
and on the hand, why would you write:

    2.5
 *  4.00
-----------------
   10.000

and not just 10.

Notice that the expectation here is that:
      2.5 * 4.00  = 10.000
but:
      2.5 * 4.000 = 10.0000
which is quite a different result.

Would you mind explaining where the additional precision comes from?


If you are working with physical quantities, the expectation is to
preserve the precision.  
If you want to be correct, you use error propagation. For high school
math you might get away with "significance arithmetic"
http://en.wikipedia.org/wiki/Significance_arithmetic
.