Module
Data.BigInt
- Package
- purescript-bigints
- Repository
- sharkdp/purescript-bigints
This module defines a BigInt data type for arbitrary length integers.
#BaseDigits Source
type BaseDigits = { isNegative :: Boolean, value :: NonEmptyArray Int }#fromNumber Source
fromNumber :: Number -> BigIntConvert a Number to a BigInt. The fractional part is truncated.
#fromString Source
fromString :: String -> Maybe BigIntParse a string into a BigInt, assuming a decimal representation. Returns
Nothing if the parse fails.
Examples:
fromString "42"
fromString "857981209301293808359384092830482"
fromString "1e100"
#toNonEmptyString Source
toNonEmptyString :: BigInt -> NonEmptyStringA decimal representation of the BigInt as a NonEmptyString.
#digitsInBase Source
digitsInBase :: Int -> BigInt -> BaseDigitsA base N representation of the BigInt as an array of digits.
- Modules
- Data.
BigInt