array-subindex icon indicating copy to clipboard operation
array-subindex copied to clipboard

Use floats as array indexes in Ruby: [ 1, 2 ][0.5] == 1.5 (Does your brain hurt yet?)

Results 2 array-subindex issues
Sort by recently updated
recently updated
newest added

We can do endless ranges in Ruby < 2.6 with `(0..Float::INFINITY)`, and in Ruby >= 2.6 with `(0..)` or `(0..nil)`. Also, in Ruby 2.7 we now have [beginless ranges](https://rubyreferences.github.io/rubychanges/2.7.html#beginless-range): `[..100]`...

enhancement

Array indexes can be ranges, or can be integers passed with a length. Right now the gem handles these in the same way that the base Array class does: ```...

enhancement
question