Module

Network.Ethereum.Web3.Types.BigNumber

Package
purescript-web3
Repository
f-o-a-m/purescript-web3

#toString Source

toString :: Radix -> BigNumber -> String

Convert a Big number into a string in the given base

#Algebra Source

class (Ring r, Ring a) <= Algebra r a  where

Class for embedding one ring inside another. Used mostly for coercing numerical values to BigNumber types. The emedding ring is refered to as the subalgebra. The embedding is assumed to be a ring homomorphism, and a is an r-bimodule under lmul and rmul.

Members

Instances

#radd Source

radd :: forall a r. Algebra r a => a -> r -> a

Add a subalgebra value on the right

#(+<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.radd (right-associative / precedence 6)

#ladd Source

ladd :: forall a r. Algebra r a => r -> a -> a

Add a subalgebra value on the left

#(>+) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.ladd (left-associative / precedence 6)

#rsub Source

rsub :: forall a r. Algebra r a => a -> r -> a

Subtract a subalgebra value on the right

#(-<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.rsub (right-associative / precedence 6)

#lsub Source

lsub :: forall a r. Algebra r a => r -> a -> a

#(>-) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.lsub (left-associative / precedence 6)

#rmul Source

rmul :: forall a r. Algebra r a => a -> r -> a

Multiply a subalgebra value on the right

#(*<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.rmul (right-associative / precedence 7)

#lmul Source

lmul :: forall a r. Algebra r a => r -> a -> a

Multiply a subalgebra value on the left

#(>*) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.lmul (left-associative / precedence 7)

#parseBigNumber Source

parseBigNumber :: Radix -> String -> Maybe BigNumber

Convert a string in the given base to a BigNumber

#toTwosComplement Source

toTwosComplement :: BigNumber -> BigNumber

Take the twos complement of a BigNumer

#pow Source

pow :: BigNumber -> Int -> BigNumber

Exponentiate a BigNumber

#unsafeToInt Source

unsafeToInt :: BigNumber -> Int

Unsafely coerce a BigNumber to an Int.

#floorBigNumber Source

floorBigNumber :: BigNumber -> BigNumber

Take the integer part of a big number

Re-exports from Data.Int

#Radix Source

newtype Radix

The number of unique digits (including zero) used to represent integers in a specific base.

#hexadecimal Source

hexadecimal :: Radix

The base-16 system.

#floor Source

floor :: Number -> Int

Convert a Number to an Int, by taking the closest integer equal to or less than the argument. Values outside the Int range are clamped, NaN and Infinity values return 0.

#decimal Source

decimal :: Radix

The base-10 system.

#binary Source

binary :: Radix

The base-2 system.