Commits

basvandijk committed 101b3fd

Fix overflow bug in scientificToNumber

Comments (0)

Files changed (1)

Data/Aeson/Types/Instances.hs

 
 scientificToNumber :: Scientific -> Number
 scientificToNumber s
-    | e < 0     = D $ fromInteger c / 10 ^ negate e
+    | e < 0     = D $ realToFrac s
     | otherwise = I $ c * 10 ^ e
   where
     e = Scientific.base10Exponent s