unwitch-3.0.0: converts between primitives
Safe HaskellNone
LanguageHaskell2010

Unwitch.Convert.Float

Description

Conversions from Float.

Synopsis

Documentation

toInteger :: Float -> Either IntegerErrors Integer Source #

Converts to Integer, fails if NaN, infinite, or has a fractional part.

toInt8 :: Float -> Either ViaIntegerErrors Int8 Source #

Converts via Integer, fails if not a whole number or out of range.

toInt16 :: Float -> Either ViaIntegerErrors Int16 Source #

Converts via Integer, fails if not a whole number or out of range.

toInt32 :: Float -> Either ViaIntegerErrors Int32 Source #

Converts via Integer, fails if not a whole number or out of range.

toInt64 :: Float -> Either ViaIntegerErrors Int64 Source #

Converts via Integer, fails if not a whole number or out of range.

toInt :: Float -> Either ViaIntegerErrors Int Source #

Converts via Integer, fails if not a whole number or out of range.

toWord8 :: Float -> Either ViaIntegerErrors Word8 Source #

Converts via Integer, fails if not a whole number or out of range.

toWord16 :: Float -> Either ViaIntegerErrors Word16 Source #

Converts via Integer, fails if not a whole number or out of range.

toWord32 :: Float -> Either ViaIntegerErrors Word32 Source #

Converts via Integer, fails if not a whole number or out of range.

toWord64 :: Float -> Either ViaIntegerErrors Word64 Source #

Converts via Integer, fails if not a whole number or out of range.

toWord :: Float -> Either ViaIntegerErrors Word Source #

Converts via Integer, fails if not a whole number or out of range.

toNatural :: Float -> Either ViaIntegerErrors Natural Source #

Converts via Integer, fails if not a whole number, out of range, or negative.

toCInt :: Float -> Either ViaIntegerErrors CInt Source #

Converts via Integer, fails if not a whole number or out of range.