Is it safe to assume 32-bit floats can be directly compared against each other if value fits the mantissa?
In a leetcode problem about finding if an integer number is sum of perfect squares, using floats instead of ints resulted in more speedup (“perfect-squares” problem). Is it safe to assume that if integer values are guaranteed to be less than 10000 and greater than or equal to 0, we can use floats instead?
Is it safe to assume 32-bit floats can be directly compared against each other if value fits the mantissa?
In a leetcode problem about finding if an integer number is sum of perfect squares, using floats instead of ints resulted in more speedup (“perfect-squares” problem). Is it safe to assume that if integer values are guaranteed to be less than 10000 and greater than or equal to 0, we can use floats instead?
Is it safe to assume 32-bit floats can be directly compared against each other if value fits the mantissa?
In a leetcode problem about finding if an integer number is sum of perfect squares, using floats instead of ints resulted in more speedup (“perfect-squares” problem). Is it safe to assume that if integer values are guaranteed to be less than 10000 and greater than or equal to 0, we can use floats instead?