Registry / utility / spl-math

spl-math

JSON →
library0.3.0rscratesunverified

Provides mathematical utilities for the Solana Program Library, including fixed-point arithmetic and common math operations.

# Cargo.toml [dependencies] spl-math = "0.3.0"
INSTALL
IMPORT
SIG · SPL-MATH
S
spl-math
utilityrustv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PreciseNumber
use spl_math::precise_number::PreciseNumber;

Demonstrates fixed-point division using PreciseNumber.

use spl_math::precise_number::PreciseNumber; fn main() { let a = PreciseNumber::new(10).unwrap(); let b = PreciseNumber::new(3).unwrap(); let result = a.div(&b).unwrap(); println!("10 / 3 = {}", result); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
spl-math — cargo add spl-math · libregistry