[Haskell-beginners] ghci: inconsistent return values for succ
Kim-Ee Yeoh
ky3 at atamo.com
Mon Oct 19 05:05:12 UTC 2015
On Sun, Oct 18, 2015 at 10:57 PM, Frothy Bits <neuralpancake at gmail.com>
wrote:
> Is the behavior I'm seeing actually related to a bug in parsec?
If you're interested in digging deeper, I'd say look at the output, not the
input end. Almost certainly the machine floating-point double for 3.14 and
(3.14+1.0) are identical across ghc, C, and python.
What's not identical is how different languages choose to display 4.14.
C and python do some display rounding so you don't see the issue. The
display algorithm in Haskell probably goes for the simple, naive approach.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151019/8e3b7399/attachment.html>
More information about the Beginners
mailing list