Changeset 5387 for src/Pugs/Prim/Numeric.hs
- Timestamp:
- 07/11/05 04:12:53 (3 years ago)
- svk:copy_cache_prev:
- 7349
- Files:
-
- 1 modified
-
src/Pugs/Prim/Numeric.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Numeric.hs
r2989 r5387 3 3 4 4 module Pugs.Prim.Numeric ( 5 op2Numeric, op1Floating, op1 Numeric,5 op2Numeric, op1Floating, op1Round, op1Numeric, 6 6 op2Exp, op2Divide, op2Modulus, 7 7 ) where … … 36 36 foo <- fromVal v 37 37 return $ VNum $ f foo 38 39 op1Round :: (Double -> Integer) -> Val -> Eval Val 40 op1Round f v = do 41 return $ VInt $ case v of 42 VInt i -> i 43 VRat r -> f ((fromRational r)::Double) 44 VNum n -> f n 45 _ -> 0 38 46 39 47 op1Numeric :: (forall a. (Num a) => a -> a) -> Val -> Eval Val
