[Haskell-cafe] Problems with truncate big float values in Haskell

Albert Y. C. Lai trebla at vex.net
Thu Jan 5 19:30:57 UTC 2017


On 2017-01-05 01:16 PM, Henson wrote:
> I have one Rational number (3 + sqrt 5)

Irrational Number.

> let x = (truncate ((3 + sqrt 5) ^ 2000000)) `mod` 1000 and result is 216.

You need to firstly read http://floating-point-gui.de/formats/fp/ , and 
secondly google for "goldberg floating point" and read "what every 
computer scientist should know about floating-point arithmetic".



More information about the Haskell-Cafe mailing list