Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

`Data.Text.Read.rational` no more accurate than `Data.Text.Read.double` #34

Open
reinerp opened this Issue · 0 comments

1 participant

@reinerp

The documentation on double states that it loses accuracy on some inputs, but using rational will fix this. I understood this to mean that if one simply used rational :: Reader Double, then one would get completely accurate results, but this doesn't appear to be the case. For instance, given the input string "5.781884674518029e-2", double :: Reader Double and rational :: Reader Double both produce an output of "5.7818846745180286e-2", whereas Prelude.read :: String -> Double produces "5.781884674518029e-2".

Perhaps the documentation means that one should actually use rational :: Reader Rational and then convert to Double with fromRational? If so, that isn't clear from the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.