[Haskell-cafe] 'Scientific' loses significant digits

Chris Wong lambda.fairy at gmail.com
Wed Aug 26 00:00:51 UTC 2015


On Wed, Aug 26, 2015 at 10:34 AM, Alex <alex323 at gmail.com> wrote:
> Hi:
>
> Does anyone know why is this true?
>
> ((fromJust . readMaybe) "1.00000000" :: Scientific) == ((fromJust . readMaybe) "1" :: Scientific)

Hi Alex,

This is intended behavior.

Scientific's primary use case is as an intermediate type, to be
converted to e.g. Double or Integer later. So there's no need for it
to account for significant digits.

> --
> Alex
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

-- 
Chris Wong (https://lambda.xyz)

"Humans find such fascinating ways to waste their time."
    -- Steven Universe


More information about the Haskell-Cafe mailing list