Skip to content

Commit

Permalink
QC-2.14.3 Double generators generates infinite number too
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Jun 1, 2023
1 parent 15d9246 commit 58766a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/PropUtils.hs
Expand Up @@ -51,8 +51,9 @@ import qualified Data.Aeson.Decoding as Dec

encodeDouble :: Double -> Double -> Property
encodeDouble num denom
| isInfinite d || isNaN d = encode d === "null"
| otherwise = (read . L.unpack . encode) d === d
| isNaN d = encode d === "null"
| isInfinite d = if d > 0 then encode d === "\"+inf\"" else encode d === "\"-inf\""
| otherwise = (read . L.unpack . encode) d === d
where d = num / denom

encodeInteger :: Integer -> Property
Expand Down

0 comments on commit 58766a1

Please sign in to comment.