issie


NumberHelpers

Namespace: global

Functions and values

Function or valueDescription
bin(num)
Signature: num:int -> string
bin64(num)
Signature: num:int64 -> string
bitToString(bit)
Signature: bit:Bit -> string

Convert a bit to string.

convertIntToWireData width num
Signature: width:int -> num:int64 -> WireData

Convert an int into a Bit list with the provided width. The Least Significant Bits are the one with low index (e.g. LSB is at position 0, MSB is at position N). Little Endian. If the number has more bits than width, then more bits will be returned.

convertWireDataToInt(bits)
Signature: bits:WireData -> int64

Convert a list of Bits into an int. The Least Significant Bits are the one with low index (e.g. LSB is at position 0, MSB is at position N). Little Endian.

dec(num)
Signature: num:int -> string
dec64(num)
Signature: num:int64 -> string
hex(num)
Signature: num:int -> string
hex64(num)
Signature: num:int64 -> string
sDec64(num)
Signature: num:int64 -> string
strToInt(str)
Signature: str:string -> Result<int64,string>

Try to convert a string to an int, or return an error message if that was not possible.

strToIntCheckWidth str width
Signature: str:string -> width:int -> Result<int64,string>

Convert a string to a number making sure that it has no more bits than specified in width.