Ha I would love to know if you did measurements for the performance here.
Maybe Math.floor is more expensive than our linear search :)