Commit b3163aef authored by simonm's avatar simonm
Browse files

[project @ 1998-01-07 18:27:51 by simonm]

add nofib/GHC_ONLY/array002 to the array test suite.
parent 7f9b96f5
import Ratio -- 1.3
import Array -- 1.3
infix 1 =:
(=:) a b = (a,b)
main = putStr (shows sub_b "\n")
where
sub_b :: Array Int Double
sub_b = ixmap (102, 113) id b
b :: Array Int Double
b = map ( \ r -> fromRational r / pi )
(ixmap (101,200) (\ i -> toInteger i - 100) a)
a :: Array Integer (Ratio Integer)
a = array (1,100) ((1 =: 1) : [i =: fromInteger i * a!(i-1)
| i <- [2..100]])
array (102, 113) [(102, 0.6366197723675814), (103, 1.909859317102744), (104, 7.639437268410976), (105, 38.197186342054884), (106, 229.1831180523293), (107, 1604.281826366305), (108, 12834.25461093044), (109, 115508.29149837396), (110, 1155082.9149837396), (111, 1.2705912064821135e7), (112, 1.5247094477785364e8), (113, 1.9821222821120973e9)]
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