bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculation error


From: Kevin Ryde
Subject: Re: Calculation error
Date: Sat, 13 Dec 2003 09:05:12 +1000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Wu Zhenhua <address@hidden> writes:
>
> In the last line: the number "55511151231257827021181583404541015625"
> always appears 16 magnitudes after the last non-zero digit. It seems like
> some systematic error inside calculation.

The number 0.1 cannot be represented exactly in binary.  It's rounded
to a certain binary fraction when you write it as a C "double"
constant like that.

If you want 1000 bits worth of 0.1 then you can use a string or a
division to initialize your mpf.

-- 
All followups to address@hidden please.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]