4 structure F
= MLton
.Finalizable
12 F
.addFinalizer(t
,finalize
);
16 fun from_string (_
:string) =
20 F
.withValue(x
,fn p
=> ());
24 val zero
= from_string
"0.0"
26 (* NOTE
: I removed the F
.withValue lines
in an attempt to make the
27 code simpler
, but the bug didn
't manifest itself
. So I think these
28 lines are critical
. *)
33 F
.withValue(x
,fn xp
=>
34 F
.withValue(y
,fn yp
=>
35 F
.withValue(z
,fn zp
=>
45 fun bigsum (n
,store
) =
46 if n
= 0 then store
else
48 val _
= if Int.mod(n
,10000) = 0 then print (Int.toString n ^
"\n") else ()
50 bigsum(Int.-(n
,1),B
.plus(store
,B
.from_string(Int.toString n ^
".0")))
53 val bigsum
= (fn n
=> bigsum(n
,B
.zero
))
55 val x
= bigsum
5000000