logoalt Hacker News

danielEMyesterday at 7:24 AM1 replyview on HN

> 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?


Replies

danielEMyesterday at 7:39 AM

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) {

    rightPrevious = right;

    right /= 2;

    counter++
}

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

show 1 reply