-
Notifications
You must be signed in to change notification settings - Fork 157
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
formatRealFloat rounds numbers differently than Numeric counterparts #105
Comments
bos
added a commit
that referenced
this issue
Dec 12, 2014
bos
added a commit
that referenced
this issue
Dec 12, 2014
bos
added a commit
that referenced
this issue
Dec 12, 2014
Thanks. I've released the fix as 1.2.0.3. |
jsonn
pushed a commit
to jsonn/pkgsrc
that referenced
this issue
Dec 13, 2014
changelog: 1.2.0.3 * Update formatRealFloat to correspond to the definition in versions of base newer than 4.5 (haskell/text#105)
bos
added a commit
that referenced
this issue
Feb 18, 2015
bos
added a commit
that referenced
this issue
Feb 18, 2015
bos
added a commit
that referenced
this issue
Feb 18, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
formatRealFloat
fromData.Text.Lazy.Builder.RealFloat
on GHC 7.8.3 sometimes rounds decimals differently than theshow*Float
functions fromNumeric
. An example:Upon a quick glance, it looks like this discrepancy is caused by the
roundTo
function inData.Text.Internal.Builder.RealFloat.Functions
. The implementation seems to be based off of the identically named functionroundTo
inGHC.Float
(at least, up tobase-4.5.1.0
). Inbase-4.6.0.0
, however, the implementation ofroundTo
was changed, which would expain the different results.Perhaps using CPP pragmas to produce the correct implementation of
roundTo
depending on which version ofbase
is being used would fix this problem?The text was updated successfully, but these errors were encountered: