-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data.ByteString.Char8.readDouble? #598
Comments
This is currently covered by |
Checking it out, ghci> :m + Data.Maybe Data.ByteString.Lex.Fractional Data.ByteString.Char8
ghci> readbslex :: String -> Double; readbslex = fst . fromJust . readExponential . pack
ghci> readbslex "12.3e-2" == readbslex "123e-3"
False
ghci> readDbl :: String -> Double; readDbl = read
ghci> readDbl "12.3e-2" == readDbl "123e-3"
True If we have this function in |
Makes sense to me. @clyring what do you think? |
Sorry for the slow response. I would be happy to add these functions with correct rounding behavior. I'm not too fussed about matching |
We have
readInt
andreadInteger
but noreadDouble
. Of course, the implementation will be more complex compared toreadInt
, but I would like to see it unless there is some good reason to not have it.The text was updated successfully, but these errors were encountered: