-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
enhancementNew feature or requestNew feature or request
Description
As the recent issues point out, the Ranges are tricky with floats as spacing. It'd be nice to be able to do arithmetic on Ranges, so that we can have Ranges generated from integers and multiplied by the required spacing later on. Something like this
// Go from 0 to 1 in N+1 steps
var N = 10
var range = 0..N // I think this is always exact?
range = range/N // This operation, if possible, would give a Range going from 0 to 1 exactly in N+1 steps, without worrying about floating point.
Alternatively or additionally, we could have a different kind of Range object going from a to b in a fixed number of steps (like NumPy's linspace), may be with the notation a..b::N or something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request