TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/X-ARTEMIS/ASTD/llms.txt
Use this file to discover all available pages before exploring further.
astd/math/cppmath.hpp header provides three lightweight, template-based free functions for common mathematical operations. Because every function accepts const auto parameters, they work with any numeric type that supports the required operators — no explicit template instantiation is needed.
power
Raises a base value to a non-negative integer exponent using iterative multiplication.
Parameters
The base value to be raised. Accepts any numeric type that supports
*=.The exponent to raise
base to. Values less than or equal to 0 cause the
function to return 1 immediately.Return value
The value of
base raised to exponent. Returns 1 when exponent <= 0.Example
square
Returns the square of a value by multiplying it by itself.
Parameters
The value to square. Accepts any type that supports the binary
* operator.Return value
The product of
base * base, preserving the operand’s type.Example
getNumType
Determines whether a number is even or odd.
The function returns
true for even numbers and false for odd
numbers. This convention might feel counter-intuitive — consider wrapping
the result in a named boolean if call-site clarity matters.Parameters
The integer value to inspect. Accepts any integral type that supports the
% (modulo) operator.Return value
true if num is even (num % 2 == 0), false if num is odd.