Comment by danielEM
20 hours ago
> The trick is a technique called fractional indexing, in which indices are fractions rather than integers.
How many times you can use fractional indexing before it stops working?
20 hours ago
> The trick is a technique called fractional indexing, in which indices are fractions rather than integers.
How many times you can use fractional indexing before it stops working?
Sorry, just did that test - it is 1075, not massive, I would risk saying that may be major issue of this lib.
Here is the code:
let left = 0, right = 1
let rightPrevious = 2
let counter = 0;
while (right > left && right < rightPrevious) {
}
console.log(counter)
Did look very briefly into repo, but didn't find a place where it is handled and don't have time to dig it, but if that issue is true I may help with resolving it. LMK
Good point. Usually fractional indexing is done with arbitrary-precision numbers to avoid exactly this issue. We landed on using JS floats to teach the technique because it makes it more intuitive to understand what’s going on, but you make a good point and I’ll make sure we add that caveat and link out to an arbitrary-precision fractional index library.