List Comprehensions with float iterator

Is it a bug or a feature? :)

Copy Source
Copy Link
Tools:
1: let dl = 9.5 / 11.
2: let min = 21.5 + dl
3: let max = 40.5 - dl
4: 
5: let a = [ for z in min .. dl .. max -> z ] // should have 21 elements
6: let b = a.Length
val dl : float

Full name: Snippet.dl

  type: float
  implements: System.IComparable
  implements: System.IFormattable
  implements: System.IConvertible
  implements: System.IComparable<float>
  implements: System.IEquatable<float>
  inherits: System.ValueType
val min : float

Full name: Snippet.min

  type: float
  implements: System.IComparable
  implements: System.IFormattable
  implements: System.IConvertible
  implements: System.IComparable<float>
  implements: System.IEquatable<float>
  inherits: System.ValueType
val max : float

Full name: Snippet.max

  type: float
  implements: System.IComparable
  implements: System.IFormattable
  implements: System.IConvertible
  implements: System.IComparable<float>
  implements: System.IEquatable<float>
  inherits: System.ValueType
val a : float list

Full name: Snippet.a

  type: float list
  implements: System.Collections.IStructuralEquatable
  implements: System.IComparable<List<float>>
  implements: System.IComparable
  implements: System.Collections.IStructuralComparable
  implements: System.Collections.Generic.IEnumerable<float>
  implements: System.Collections.IEnumerable
val z : float

  type: float
  implements: System.IComparable
  implements: System.IFormattable
  implements: System.IConvertible
  implements: System.IComparable<float>
  implements: System.IEquatable<float>
  inherits: System.ValueType
val b : int

Full name: Snippet.b

  type: int
  implements: System.IComparable
  implements: System.IFormattable
  implements: System.IConvertible
  implements: System.IComparable<int>
  implements: System.IEquatable<int>
  inherits: System.ValueType
property List.Length: int

More information

Link: http://fssnip.net/3H
Posted: 3 years ago
Author: Oldrich Svec (website)
Tags: List Comprehensions