:: String -> Int is:exact -package:string-conversions -package:speculate -package:hxt -package:ghc-lib-parser package:ghc
Convert to an
Int. It is implementation-dependent what
fromEnum returns when applied to a value that is too large to
fit in an
Int.
a constant function, returning the number of digits of
floatRadix in the significand
The
read function reads input from a string, which must be
completely consumed by the input process.
read fails with an
error if the parse is unsuccessful, and it is therefore
discouraged from being used in real applications. Use
readMaybe
or
readEither for safe alternatives.
>>> read "123" :: Int
123
>>> read "hello" :: Int
*** Exception: Prelude.read: no parse
Return the number of bits in the type of the argument. The actual
value of the argument is ignored. The function
bitSize is
undefined for types that do not have a fixed bitsize, like
Integer.
Default implementation based upon
bitSizeMaybe provided since
4.12.0.0.
Return the number of set bits in the argument. This number is known as
the population count or the Hamming weight.
Can be implemented using
popCountDefault if
a is also
an instance of
Num.
Count number of zero bits preceding the most significant set bit.
countLeadingZeros (zeroBits :: a) = finiteBitSize (zeroBits :: a)
countLeadingZeros can be used to compute log base 2 via
logBase2 x = finiteBitSize x - 1 - countLeadingZeros x
Note: The default implementation for this method is intentionally
naive. However, the instances provided for the primitive integral
types are implemented using CPU specific machine instructions.
Default implementation for
popCount.
This implementation is intentionally naive. Instances are expected to
provide an optimized implementation for their size.
Return the number of bits in the type of the argument. The actual
value of the argument is ignored. Returns Nothing for types that do
not have a fixed bitsize, like
Integer.
See if this instruction is telling us the current C stack delta