Guest User

Untitled

a guest
Oct 16th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. > [0..10];;
  2. val it : int list = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
  3. > [10..-1..0];;
  4. val it : int list = [10; 9; 8; 7; 6; 5; 4; 3; 2; 1; 0]
  5. > [0..2..10];;
  6. val it : int list = [0; 2; 4; 6; 8; 10]
  7. > [10..-2..0];;
  8. val it : int list = [10; 8; 6; 4; 2; 0]
  9. > [0..0.5..10];;
  10.  
  11.  
  12. ~/sandbox/fsharp/range.fs(16,5): error FS0001: The type 'float' does not match the type 'int'
  13. > [0.0..0.5..10.0];;
  14. val it : float list =
  15. [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;
  16. 7.5; 8.0; 8.5; 9.0; 9.5; 10.0]
  17. >
Add Comment
Please, Sign In to add comment