KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why is the behavior of the Haskell range notation different for floats than for integers and chars? Prelude> [1, 3 .. 10] :: [Int] [1,3,5,7,9] Prelude> [1, 3 .. 10] :: [Float] [1.0,3.0,5.0,7.0,9.0,11.0] Prelude> ['a', 'c' .. 'f'] "ace" I would understand it if the last element was close to the upper bound, but this is obviously not a rounding issue.
Tags (comma-separated)
Save Edits
Cancel