Function lupnt::PowInt

Function Documentation

double lupnt::PowInt(double base, int exponent)

Raise base to an integer power (positive, negative, or zero), without relying on std::pow.

Used by UnitSystem::FromSI/UnitSystem::ToSI to build dimensional scale factors (length^a * time^b * mass^c) at compile time.

Parameters:
  • base – Base value

  • exponent – Integer exponent (may be negative)

Returns:

base raised to exponent