cpp/openlocationcode.cc
// Raises a number to an exponent, handling negative exponents.
Raises a number to an exponent, handling negative exponents.
Raises a number to an exponent handling negative exponents .
double pow_neg(double base, double exponent) {
  if (exponent == 0) {
    return 1;
  } else if (exponent > 0) {
    return pow(base, exponent);
  }
  return 1 / pow(base, -exponent);
}
double pow_neg ( double base , double exponent ) { if ( exponent == 0 ) { return 1 ; } else if ( exponent > 0 ) { return pow ( base , exponent ) ; } return 1 / pow ( base , - exponent ) ; }
Raises a number to an exponent, handling negative exponents.
Raises a number to an exponent handling negative exponents .