Commit 6a58730c authored by Ian Lynagh's avatar Ian Lynagh

Whitespace only in cgrun044.hs

parent 610c0e65
...@@ -23,7 +23,7 @@ main = do ...@@ -23,7 +23,7 @@ main = do
sequence_ (map putStrLn float_tests) sequence_ (map putStrLn float_tests)
where where
double_tests = run_tests double_numbers double_tests = run_tests double_numbers
float_tests = run_tests float_numbers float_tests = run_tests float_numbers
run_tests nums = run_tests nums =
map ($ nums) map ($ nums)
...@@ -41,39 +41,39 @@ double_numbers = ...@@ -41,39 +41,39 @@ double_numbers =
[ 0 [ 0
, encodeFloat 0 0 -- 0 using encodeFloat method , encodeFloat 0 0 -- 0 using encodeFloat method
, mkDouble (reverse_if_bigendian [0,0,0,0,0,0, 0xf0, 0x7f]) -- +inf , mkDouble (reverse_if_bigendian [0,0,0,0,0,0, 0xf0, 0x7f]) -- +inf
, encodeFloat 1 2047 -- +Inf , encodeFloat 1 2047 -- +Inf
, encodeFloat 1 2048 , encodeFloat 1 2048
, encodeFloat 1 2047 -- signalling NaN , encodeFloat 1 2047 -- signalling NaN
, encodeFloat 0xf000000000000 2047 -- quiet NaN , encodeFloat 0xf000000000000 2047 -- quiet NaN
, 0/(0::Double) , 0/(0::Double)
-- misc -- misc
, 1.82173691287639817263897126389712638972163e-300 , 1.82173691287639817263897126389712638972163e-300
, 1.82173691287639817263897126389712638972163e+300 , 1.82173691287639817263897126389712638972163e+300
, 4.9406564558412465e-324 -- smallest possible denorm number , 4.9406564558412465e-324 -- smallest possible denorm number
-- (as reported by enquire running -- (as reported by enquire running
-- on a i686-pc-linux.) -- on a i686-pc-linux.)
, 2.2250738585072014e-308 , 2.2250738585072014e-308
, 0.11 , 0.11
, 0.100 , 0.100
, -3.4 , -3.4
-- smallest -- smallest
, let (l, _) = floatRange x , let (l, _) = floatRange x
x = encodeFloat 1 (l-1) x = encodeFloat 1 (l-1)
in x in x
-- largest -- largest
, let (_, u) = floatRange x , let (_, u) = floatRange x
d = floatDigits x d = floatDigits x
x = encodeFloat (floatRadix x ^ d - 1) (u - d) x = encodeFloat (floatRadix x ^ d - 1) (u - d)
in x in x
] ]
float_numbers :: [Float] float_numbers :: [Float]
float_numbers = float_numbers =
[ 0 [ 0
, encodeFloat 0 0 -- 0 using encodeFloat method , encodeFloat 0 0 -- 0 using encodeFloat method
, encodeFloat 1 255 -- +Inf , encodeFloat 1 255 -- +Inf
, encodeFloat 1 256 , encodeFloat 1 256
, encodeFloat 11 255 -- signalling NaN , encodeFloat 11 255 -- signalling NaN
, encodeFloat 0xf00000 255 -- quiet NaN , encodeFloat 0xf00000 255 -- quiet NaN
, 0/(0::Float) , 0/(0::Float)
-- misc -- misc
...@@ -85,15 +85,15 @@ float_numbers = ...@@ -85,15 +85,15 @@ float_numbers =
, 0.11 , 0.11
, 0.100 , 0.100
, -3.4 , -3.4
-- smallest -- smallest
, let (l, _) = floatRange x , let (l, _) = floatRange x
x = encodeFloat 1 (l-1) x = encodeFloat 1 (l-1)
in x in x
-- largest -- largest
, let (_, u) = floatRange x , let (_, u) = floatRange x
d = floatDigits x d = floatDigits x
x = encodeFloat (floatRadix x ^ d - 1) (u - d) x = encodeFloat (floatRadix x ^ d - 1) (u - d)
in x in x
] ]
------------- -------------
...@@ -176,7 +176,7 @@ doubleOrFloat ls ...@@ -176,7 +176,7 @@ doubleOrFloat ls
-- make a double from a list of 8 bytes -- make a double from a list of 8 bytes
-- (caller deals with byte ordering.) -- (caller deals with byte ordering.)
mkDouble :: [Word8] -> Double mkDouble :: [Word8] -> Double
mkDouble ls = mkDouble ls =
runST (( do runST (( do
arr <- newArray_ (0,7) arr <- newArray_ (0,7)
sequence (zipWith (writeArray arr) [(0::Int)..] (take 8 ls)) sequence (zipWith (writeArray arr) [(0::Int)..] (take 8 ls))
...@@ -185,10 +185,10 @@ mkDouble ls = ...@@ -185,10 +185,10 @@ mkDouble ls =
) :: ST s Double ) ) :: ST s Double )
showAndPerform :: (Show a, Show b) showAndPerform :: (Show a, Show b)
=> (a -> b) => (a -> b)
-> String -> String
-> a -> a
-> String -> String
showAndPerform fun name_fun val = showAndPerform fun name_fun val =
name_fun ++ ' ':show val ++ " = " ++ show (fun val) name_fun ++ ' ':show val ++ " = " ++ show (fun val)
......
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