Closed yakubin closed 1 year ago
Similarly, in the explanation of Interval Index:
Similarly, elements greater than the last bin will end up with a bin number equal to the number of elements (note: not the number of bins) to the left:
And the following example is given:
3 5 7 9⍸0 100
┌→───┐
│¯1 3│
└~───┘
There are 4 elements on the left side of ⍸
and for 100 it returns 3, not 4. If we set ⎕IO
to 1 on the other hand, the explanation is correct (for 100, but not for 0, which now gets 0 instead of -1):
⎕IO ← 1
3 5 7 9⍸0 100
┌→──┐
│0 4│
└~──┘
Thank you for pointing this out. I'll be sure to address this in the next update I make.
In Glyphiary, there is the sentence:
This is true only if the index origin is 1. However, this very chapter (and the entire book so far) starts with setting it to 0:
Therefore, the sentence should instead read something like:
Alternatively: