2 ms·
That's especially a shame, because log2 of a floating point value is particularly easy to calculate, and most math libraries will internally calculate logs of o
by jbay808 6y ago
That's especially a shame, because log2 of a floating point value is particularly easy to calculate, and most math libraries will internally calculate logs of other based (like ln) by finding the equivalent log2 first and then converting it.
And if you want just the floor of the base-2 log, you almost don't even need to calculate it at all; it's right there in the exponent bits.