Hi, I’m currently working on a module which is quite similar to BigNum in that I’m trying to adapt numbers larger than ~1.7e308 into my game. I’ve implemented all the other metamethods that I can (__add, __sub, __mul etc.) but I’m stuck on how to make __pow.

The obvious solution here is to convert the exponent (containing the coefficient and exponent) to a number and use standard math to change the coefficient (confusing sentence). But in the exceptionally rare case I need to raise something past the ~1.7e308 power and I can’t just convert it to a number, how should I handle this? Should I use iteration or is there a nicer way to do this without it. Thanks.