Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > [0..10];;
- val it : int list = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
- > [10..-1..0];;
- val it : int list = [10; 9; 8; 7; 6; 5; 4; 3; 2; 1; 0]
- > [0..2..10];;
- val it : int list = [0; 2; 4; 6; 8; 10]
- > [10..-2..0];;
- val it : int list = [10; 8; 6; 4; 2; 0]
- > [0..0.5..10];;
- ~/sandbox/fsharp/range.fs(16,5): error FS0001: The type 'float' does not match the type 'int'
- > [0.0..0.5..10.0];;
- val it : float list =
- [0.0; 0.5; 1.0; 1.5; 2.0; 2.5; 3.0; 3.5; 4.0; 4.5; 5.0; 5.5; 6.0; 6.5; 7.0;
- 7.5; 8.0; 8.5; 9.0; 9.5; 10.0]
- >
Add Comment
Please, Sign In to add comment