package
0.0.0-20241001224614-fe19dca0e511
Repository: https://github.com/bondmachinehq/bondmachine.git
Documentation: pkg.go.dev

# README

BMNumbers

bmnumbers is part of BondMachine project. bmnumbers is both a command line tool to convert or cast numbers to and from different formats and a library to do the same. It is used within the BondMachine every time numbers are handled.

Supported number types

The supported number types are listed in the following table.

Type NamePrefixesDescriptionStaticLenght
unsignednone
0u
0d
Unsigned integeryesany
signed0s
0sd
Signed integeryesany
bin0b
0b<s>
Binary numberyesany
s bits
hex0xHexadecimal numberyesany
float160f<16>IEEE 754 half precision floating point numberyes16 bits
float320f
0f<32>
IEEE 754 single precision floating point numberyes32 bits
lqs[s]t[t]0lq<s.t>Linear quantized number with size s and type tnos bits
fps[s]f[f]0fp<s.f>Fixed point number with size s and fraction fnos bits
flp[e]f[f]0flp<e.f>FloPoCo floating point number with exponent e and mantissa fnoe+f+3 bits