cdar-mBound-0.1.0.4: Exact real arithmetic using Centred Dyadic Approximations
Safe HaskellNone
LanguageHaskell2010

Data.CDAR.IntegerLog

Description

The IntegerLog module provides a fast integer logarithm in base 2. Current implementation relies in the integer-gmp package.

Synopsis

Documentation

integerLog2 :: Integer -> Int Source #

The integerLog2 function gives the floor of the logarithm of a positive integer. For non-positive arguments the returned result is meaningless. Possible overflow of returned value is ignored.

It could be argued that NegInf should be returned for 0 if the return type had been Extended Int.