Décio Luiz Gazzoni Filho
decio at decpp.net
Thu Oct 19 15:06:36 CEST 2006
On Oct 19, 2006, at 6:01 AM, piix wrote:
> Although i got no errors while 'make check' these results are clearly
> wrong. Has somebody the same problem or a solution,
Go read a book on numerical analysis before you run around spouting
bullshit about stuff you're ignorant on.
From the manual (http://www.swox.com/gmp/manual/Floating_002dpoint-
``The mantissa in stored in binary, as might be imagined from the
fact precisions are expressed in bits. One consequence of this is
that decimal fractions like 0.1 cannot be represented exactly. The
same is true of plain IEEE double floats. This makes both highly
unsuitable for calculations involving money or other values that
should be exact decimal fractions. (Suitably scaled integers, or
perhaps rationals, are better choices.)''
Also, how about you try the same in plain old C? Using `float' as the
base type, I get this:
Using `double', I get:
But obviously that was too much work for you to try, right? Or you
just assumed it was going to work OK, but you never tried, right?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20061019/8e0805bc/attachment.bin
More information about the gmp-discuss