Documentation home / Native Module API
Native Module API
Scalar Mathematics
Scalar mathematical helpers and constants for common arithmetic, rounding, logarithmic and exponential operations.
Purpose
Scalar mathematical helpers and constants for common arithmetic, rounding, logarithmic and exponential operations.
Exported API
| Export | Role |
|---|---|
abs | abs native function or exported value |
floor | floor native function or exported value |
ceil | ceil native function or exported value |
round | round native function or exported value |
sqrt | sqrt native function or exported value |
log | log native function or exported value |
log10 | log10 native function or exported value |
exp | exp native function or exported value |
pow | pow native function or exported value |
min | min native function or exported value |
max | max native function or exported value |
clamp | clamp native function or exported value |
pi | pi native function or exported value |
e | e native function or exported value |
Usage example
import gs_math; print(gs_math.sqrt(81)); print(gs_math.pow(2, 10)); print(gs_math.clamp(150, 0, 100)); print(gs_math.pi);
This module is distinct from gsnum and gs_compute; use its small scalar API for basic math.
