1

I've written a JS math library for very large numbers that preserves precision and can be used for any base. The entire library is custom because none of the default math functions can handle numbers of these magnitude.

This means the power handler has to be custom as well. Simple enough for integer powers, but the only method for calculating decimal powers I've found is to do do sqrt(1^0*num^1) and (0+1)/2 and repeating the process until the second number equals the decimal portion of the power. Is this the basic concept behind most decimal powers or is there a non guess and check method?

Rhyono
  • 2,420
  • 1
  • 25
  • 41

1 Answers1

1

Decimal powers use logarithms, since bx = ex ln b. Naturally this requires arbitrary-precision logarithm and exponentiation capability, but choosing a suitable logarithm base can make this manageable.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358