1 #pragma once // Source encoding: UTF-8 with BOM (π is a lowercase Greek "pi"). 16 inline auto intpow(
const double base,
const int exponent )
21 for(
int n = exponent; n != 0; weight *= weight )
45 template<
class Number =
double >
46 inline auto intpow(
const Number base,
const int exponent )
62 inline auto cubed(
const double x )
auto intpow(const Number base, const int exponent) -> Number
Efficient x to the n'th power, when n is an integer.
auto squared(const double x) -> double
The square (second power) of the argument.
CPPX_USE_CPPX(intpow, squared, cubed)
Common integer operations: is_even, is_odd, intdiv, intmod, intsquare, intcube, intmin and intmax.
auto cubed(const double x) -> double
The cube (third power) of the argument.
Macros for generating more concise and clear using statements, primarily $use_cppx and $use_std,...
auto is_odd(const Int x) -> Truth