Crate solana_maths

Source
Expand description

Math for preserving precision

Structs§

Decimal
Large decimal values, precise to 18 digits
Rate
Small decimal values, precise to 18 digits
U128
Little-endian large integer type
U192
Little-endian large integer type

Enums§

MathError

Constants§

BIPS_SCALER
Scale for bips
HALF_WAD
Half of identity
PERCENT_SCALER
Scale for percentages
SCALE
Scale of precision
WAD
Identity

Traits§

TryAdd
Try to subtract, return an error on overflow
TryDiv
Try to divide, return an error on overflow or divide by zero
TryMul
Try to multiply, return an error on overflow
TrySub
Try to subtract, return an error on underflow