mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
test of fast iteration over integers
This commit is contained in:
parent
ab74acf87a
commit
74fb0a4725
1 changed files with 5 additions and 0 deletions
5
tests.ml
5
tests.ml
|
|
@ -37,4 +37,9 @@ let _ =
|
|||
(Sequence.Array.to_seq
|
||||
(Sequence.Array.of_seq (Sequence.append
|
||||
(Sequence.take 5 (Sequence.List.to_seq l3)) (Sequence.List.to_seq l4))));
|
||||
(* sum *)
|
||||
let n = 200000000 in
|
||||
let sum = Sequence.fold (+) 0 (Sequence.take n (Sequence.Int.repeat 1)) in
|
||||
Format.printf "%dx1 = %d@." n sum;
|
||||
assert (n=sum);
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue