Changeset 8800
- Timestamp:
- 01/27/06 13:35:58 (3 years ago)
- Files:
-
- 2 modified
-
src/Pugs/Prim/Numeric.hs (modified) (2 diffs)
-
t/builtins/math/NaN.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Numeric.hs
r8736 r8800 56 56 op2Exp x y = do 57 57 num1 <- fromVal =<< fromVal' x 58 if isNaN num1 then return (VNum (0/0)) else do 58 59 if num1 == (1 :: VNum) then return (VInt 1) else do 59 60 num2 <- fromVal =<< fromVal' y 61 if isNaN num2 then return (VNum (0/0)) else do 60 62 if num2 == (0 :: VNum) then return (VInt 1) else do 61 63 case reverse $ show (num2 :: VNum) of … … 66 68 else op2Num ((**) :: VNum -> VNum -> VNum) x y 67 69 _ -> op2Num ((**) :: VNum -> VNum -> VNum) x y 70 where 71 _NaN = 0/0 68 72 69 73 op2Divide :: Val -> Val -> Eval Val -
t/builtins/math/NaN.t
r8798 r8800 4 4 use Test; 5 5 6 plan 5;6 plan 6; 7 7 8 8 # Undeterminate Math results … … 13 13 is Inf / Inf, NaN, "Inf / Inf"; 14 14 is Inf - Inf, NaN, "Inf - Inf"; 15 is NaN ** 0, NaN, "NaN ** 0"; 15 16 16 17 # XXX - the semantics below are unspecified.
