See also: Userspace Index, Kernel System Services
usr/libmath contains the userspace math support library (libmath.so), a dynamically-linked shared library.
API
| Category | Functions |
|---|---|
Constants |
|
Integer |
|
Trigonometry |
|
Exponential/Log |
|
Power |
|
Rounding |
|
Min/Max |
|
Float Mod |
|
Floating Abs |
|
Init |
|
Implementation
-
291 lines of C (
math.c) -
Trigonometric functions use Taylor series expansion
-
Power functions implemented via
exp(y * log(|x|)) -
Square root uses Newton’s method
-
Logarithm uses Newton’s method with a bit-hack initial guess
-
Built as a shared library (
-shared -Wl,-soname,libmath.so,-fPIC)
Headers
-
include/libmath/math.h— Public API header (241 lines, Doxygen-style comments)