Module

Data.HugeNum

#fromString

fromString :: String -> Maybe HugeNum

Create a HugeNum from a String. Strings should be in the form of a Purescript Number. For example, fromString "123.456" => Just (HugeNum 123.456)

#fromNumber

#toNumber

toNumber :: HugeNum -> Number

Creates a HugeNum from a Number. May lose precision if the argument is too large.

#toString

#integerPart

integerPart :: HugeNum -> HugeNum

Returns the integer part of a HugeNum.

#fractionalPart

fractionalPart :: HugeNum -> HugeNum

Returns the fractional part of a HugeNum.

#numOfIntegral

numOfIntegral :: HugeNum -> Int

Counts how many digits are before the decimal.

#numOfFractional

numOfFractional :: HugeNum -> Int

Counts how many digits are after the decimal.

#abs

abs :: HugeNum -> HugeNum

Creates a nonnegative value with the same magnitude as the argument.

#neg

neg :: HugeNum -> HugeNum

Flips the sign. While negate from the Prelude does the same, this is faster.

#isNegative

#isPositive

#isZero

#floor

floor :: HugeNum -> HugeNum

Returns the closest integer-valued HugeNum less than or equal to the argument.

#ceil

ceil :: HugeNum -> HugeNum

Returns the closest integer-valued HugeNum greater than or equal to the argument.

#round

round :: HugeNum -> HugeNum

Returns the closest integer-valued HugeNum to the argument.

#googol

#subHugeNum

#pow

pow :: HugeNum -> Int -> HugeNum

Raise a HugeNum to an integer power.

#(^)

Operator alias for Data.HugeNum.pow (right-associative / precedence 8)

#truncate

truncate :: Int -> HugeNum -> HugeNum

Limits the number of digits past the decimal.

Modules