Documentation ¶
Overview ¶
Package fixedpoint provides constants, as well as formatting, conversion, and checking functionality for Cadence fixed-point number types
Index ¶
- Constants
- Variables
- func CheckRange(negative bool, ...) bool
- func ConvertToFixedPointBigInt(negative bool, unsignedInteger *big.Int, fractional *big.Int, scale uint, ...) *big.Int
- func NewFix64(negative bool, unsignedInteger *big.Int, fractional *big.Int, parsedScale uint) (*big.Int, error)
- func NewUFix64(unsignedInteger *big.Int, fractional *big.Int, parsedScale uint) (*big.Int, error)
- func ParseFix64(s string) (*big.Int, error)
- func ParseUFix64(s string) (*big.Int, error)
Constants ¶
View Source
const Fix64Factor = 100_000_000
View Source
const Fix64Scale = 8
View Source
const Fix64TypeMaxFractional = math.MaxInt64 % Fix64Factor
View Source
const Fix64TypeMaxInt = math.MaxInt64 / Fix64Factor
View Source
const Fix64TypeMinFractional = math.MinInt64 % Fix64Factor
View Source
const Fix64TypeMinInt = math.MinInt64 / Fix64Factor
View Source
const UFix64TypeMaxFractional = math.MaxUint64 % uint64(Fix64Factor)
View Source
const UFix64TypeMaxInt = math.MaxUint64 / uint64(Fix64Factor)
View Source
const UFix64TypeMinFractional = 0
View Source
const UFix64TypeMinInt = 0
Variables ¶
View Source
var Fix64TypeMaxFractionalBig = new(big.Int).SetInt64(Fix64TypeMaxFractional)
View Source
var Fix64TypeMaxIntBig = new(big.Int).SetInt64(Fix64TypeMaxInt)
View Source
var Fix64TypeMinFractionalBig = new(big.Int).SetInt64(Fix64TypeMinFractional)
View Source
var Fix64TypeMinIntBig = new(big.Int).SetInt64(Fix64TypeMinInt)
View Source
var UFix64TypeMaxFractionalBig = new(big.Int).SetUint64(UFix64TypeMaxFractional)
View Source
var UFix64TypeMaxIntBig = new(big.Int).SetUint64(UFix64TypeMaxInt)
View Source
var UFix64TypeMinFractionalBig = new(big.Int).SetUint64(UFix64TypeMinFractional)
View Source
var UFix64TypeMinIntBig = new(big.Int).SetUint64(UFix64TypeMinInt)
Functions ¶
func CheckRange ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.