You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stopping before end can be considered as bug. I will change the label of this issue accordingly.
I think Scala's approach is the best. It is performing the calculation exactly in the manner as expected and projects the result into the space of doubles. This is the best we can do.
It is like a 3d rendering scene projected on a 2d display. There's a loss of information but our brain interprets it as correct when looking at the pixels. If we would change the algorithm (linear transformation of vector matrices), we could fit the pixel space better but the visual perspective is not natural any more and our brain will interpret the rendered scene as wrong.
Interpolation of the real world is the way to go, not changing how the real world behaves.
Currently
double
range iteration can stop before theend
, if consecutive numbers have a greater distance than thestep size
.Two simple possible fixes came up:
BigDecimal
under the hood. This is somewhat slower and will result in consecutive values that are equal to each other.Note: it's unlikely that many people will create ranges with infinity or where the step size is smaller than an
ULP
.The text was updated successfully, but these errors were encountered: