Mathlib Official
Standard Math Library
Mathlib v1.0.0
The Standard Math Library for XCX.
Mathlib provides a comprehensive suite of mathematical functions, constants, and utilities designed for professional XCX development. It covers everything from basic arithmetic to advanced trigonometry and statistics.
Features
powi, powf), square roots (sqrtf), and cube roots (cbrtf).ln_f), base-2, base-10, and custom base logarithms.sin, cos, tan), inverse functions (atan, atan2, asin, acos), and hyperbolic variants.Installation
Add Mathlib to your project.pax:
`pax
deps :: [
"mathlib@1.0.0"
]
`
Then run:
xcx pax install
Usage
Include the library in your XCX files:
`xcx
include "lib/mathlib/src/math.xcx" as math;
func main() {
>! "PI: " + s(math.PI);
>! "Square root of 16: " + s(math.sqrt_f(16.0));
>! "Factorial of 5: " + s(math.factorial(5));
};
`
Professional Benchmarking
Functions like pow_i and factorial are implemented iteratively to avoid recursion depth limits and maximize performance in the XCX VM.
Published via PAX Package Manager
Install
xcx pax add Mathlib@1.0.0
Downloads
1
Stars
2