This is a special version of the regular floor function.
It works by directly calling the low-level internal GHC
primitives, and thus is as fast as you'd expect for such
a trivial operation.
(The standard floor function does something crazy like
converting a Double to a numerator/denominator Integer
pair and then computing the integer part of the quotient as
an Integer, then truncating that to a Word8. Which,
obviously, is ludicrously slow.)
Hopefully one day the need for this low-level hackery
will disappear.
|