Commits

Bryan O'Sullivan  committed 3df516a

Use a better comparison for encoded Double values.

  • Participants
  • Parent commits fc4bd01

Comments (0)

Files changed (1)

File tests/Properties.hs

 encodeDouble :: Double -> Double -> Bool
 encodeDouble num denom
     | isInfinite d || isNaN d = encode (Number (D d)) == "null"
-    | otherwise               = encode (Number (D d)) == L.pack (show d)
+    | otherwise               = (read . L.unpack . encode . Number . D) d == d
   where d = num / denom
 
 encodeInteger :: Integer -> Bool