Next And Previous Floats
The Float
class has two interesting methods for stepping forward or backwards through the numbers that can actually be represented by floats. This is handy since floats are not evenly spaced.
Use #next_float
to go forward
Use #prev_float
to go backwards
I cannot think of any practical use cases, but it is fun to know they are there if you need them.
Last updated