unwitch-3.0.0: converts between primitives
Safe HaskellNone
LanguageHaskell2010

Unwitch.Convert.Double

Description

Conversions from Double.

Synopsis

Documentation

toFloat :: Double -> Float Source #

Lossy narrowing conversion, may lose precision.

toFixed :: HasResolution a => Double -> Either RationalErrors (Fixed a) Source #

Converts a Double to a Fixed value. Rejects NaN and infinities.

toInteger :: Double -> Either IntegerErrors Integer Source #

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

toInt8 :: Double -> Either ViaIntegerErrors Int8 Source #

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

toInt16 :: Double -> Either ViaIntegerErrors Int16 Source #

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

toInt32 :: Double -> Either ViaIntegerErrors Int32 Source #

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

toInt64 :: Double -> Either ViaIntegerErrors Int64 Source #

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

toInt :: Double -> Either ViaIntegerErrors Int Source #

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

toWord8 :: Double -> Either ViaIntegerErrors Word8 Source #

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

toWord16 :: Double -> Either ViaIntegerErrors Word16 Source #

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

toWord32 :: Double -> Either ViaIntegerErrors Word32 Source #

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

toWord64 :: Double -> Either ViaIntegerErrors Word64 Source #

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

toWord :: Double -> Either ViaIntegerErrors Word Source #

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

toNatural :: Double -> Either ViaIntegerErrors Natural Source #

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

toCInt :: Double -> Either ViaIntegerErrors CInt Source #

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