Skip to content

Commit 3460cc1

Browse files
committed
Fail with an error when floating point decimals range
specification invalid.
1 parent c5499fc commit 3460cc1

File tree

1 file changed

+2
-0
lines changed
  • haskell_edsl/src/Checktestdata

1 file changed

+2
-0
lines changed

haskell_edsl/src/Checktestdata/Core.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ nextFloatP pmin pmax format = PrimOp $ do
238238
Just dp | hasexp && (BS.index sn digitpos == '0' || dp /= digitpos + 1) ->
239239
failWithLocation "exactly one non-zero before the decimal dot expected"
240240
_ -> return ()
241+
when (pmin < 0 || pmin > pmax) $
242+
failWithLocation $ "Specified decimal range " ++ show (pmin,pmax) ++ " invalid"
241243
when (ndecimals < pmin || ndecimals > pmax) $
242244
failWithLocation $ "Number of decimals (" ++ show ndecimals ++ ") not "
243245
++ "within specified range " ++ show (pmin,pmax)

0 commit comments

Comments
 (0)