Skip to content

Round trip through the parser/prettyprinter can lose precision #1

@orlitzky

Description

@orlitzky

I'm using the numbers package in GHCI, and the output precision can be truncated when it passes through the parser. An example (without ipprint):

Prelude> import Data.Number.BigFloat
Prelude Data.Number.BigFloat> 0 :: BigFloat Prec50
0.00000000000000000000000000000000000000000000000000e0

I think the problem is that we can use this output to assign to a non-big float. That is,

Prelude> let x = 0.123456789012345678901234567890e0
Prelude> x
0.12345678901234568

Maybe there's something that can be done when precision of a number is greater than that of the default? For comparison, with ipprint,

λ. import Data.Number.BigFloat
λ. let x = 0.123456789012345678901234567890e0
λ. x
    0.12345678901234568

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions