Show
Ignore:
Timestamp:
01/27/06 13:35:58 (3 years ago)
Author:
audreyt
Message:

* nnunley caught that 0**NaN should be NaN, not 0.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Numeric.hs

    r8736 r8800  
    5656op2Exp x y = do 
    5757    num1 <- fromVal =<< fromVal' x 
     58    if isNaN num1 then return (VNum (0/0)) else do 
    5859    if num1 == (1 :: VNum) then return (VInt 1) else do 
    5960    num2 <- fromVal =<< fromVal' y 
     61    if isNaN num2 then return (VNum (0/0)) else do 
    6062    if num2 == (0 :: VNum) then return (VInt 1) else do 
    6163    case reverse $ show (num2 :: VNum) of 
     
    6668                else op2Num ((**) :: VNum -> VNum -> VNum) x y 
    6769        _ -> op2Num ((**) :: VNum -> VNum -> VNum) x y 
     70    where 
     71    _NaN = 0/0 
    6872 
    6973op2Divide :: Val -> Val -> Eval Val