# 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
.

## Relevant Pages

• Re: compilation problem with module function interface definition
... The simplest and most problematic case is the precision of real literal ... single precision constant is defined without regard to context. ... some compilers encourage this expectation ... There is certainly a relation to polymorphism because the same ...
(comp.lang.fortran)
• Re: Number Due
... folks like precision in words and math. ... EXPECTATION in order to compensate. ...
(rec.gambling.craps)
• Re: Number types in Lisp
... Notice that the expectation here is that: ... Would you mind explaining where the additional precision comes from? ... math you might get away with "significance arithmetic" ...
(comp.lang.lisp)
• Re: Xilinx "somethings wrong" error
... as these vectors are, without the sizing headaches. ... -- Numeric_Std natively does modulo based math ... -- integer based math does full precision math: ... group - note the enhancement is not the LRM text - LRM ...
(comp.lang.vhdl)
• Re: Amplitude response of a Biquad Filter
... I did not venture too much into the math, ... I put a gain of +12 dB for all the bands. ... I think you are a victim of 16 bit precision. ... there is serious problem with a high sampling frequency and my first band ...
(comp.dsp)