Commit b8886039 authored by simonm's avatar simonm

[project @ 1999-02-23 10:09:49 by simonm]

Integer fixes.
parent 0800dbf6
......@@ -209,8 +209,8 @@ instance Num Int8 where
abs = absReal
signum = signumReal
fromInteger (J# s# d#)
= case (integer2Int# s# d#) of { i# -> I8# (intToInt8# i#) }
fromInteger (S# i#) = I8# (intToInt8# i#)
fromInteger (J# s# d#) = I8# (intToInt8# (integer2Int# s# d#))
fromInt = intToInt8
instance Bounded Int8 where
......@@ -360,8 +360,8 @@ instance Num Int16 where
else I16# (0x10000# -# x#)
abs = absReal
signum = signumReal
fromInteger (J# s# d#)
= case (integer2Int# s# d#) of { i# -> I16# (intToInt16# i#) }
fromInteger (S# i#) = I16# (intToInt16# i#)
fromInteger (J# s# d#) = I16# (intToInt16# (integer2Int# s# d#))
fromInt = intToInt16
instance Bounded Int16 where
......@@ -519,8 +519,8 @@ instance Num Int32 where
#endif
abs = absReal
signum = signumReal
fromInteger (J# s# d#)
= case (integer2Int# s# d#) of { i# -> I32# (intToInt32# i#) }
fromInteger (S# i#) = I32# (intToInt32# i#)
fromInteger (J# s# d#) = I32# (intToInt32# (integer2Int# s# d#))
fromInt = intToInt32
instance Bounded Int32 where
......@@ -664,7 +664,8 @@ instance Num Int64 where
negate w@(I64# x) = I64# (negateInt# x)
abs x = absReal
signum = signumReal
fromInteger (J# s# d#) = case (integer2Int# s# d#) of { i# -> I64# i# }
fromInteger (S# i#) = I64# i#
fromInteger (J# s# d#) = I64# (integer2Int# s# d#)
fromInt = intToInt64
instance Bounded Int64 where
......@@ -760,6 +761,7 @@ int64ToInteger (I64# x#) =
(# s#, p# #) -> J# s# p#
integerToInt64 :: Integer -> Int64
integerToInt64 (S# i#) = I64# (intToInt64# i#)
integerToInt64 (J# s# d#) = I64# (integerToInt64# s# d#)
instance Eq Int64 where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment