RX0304

Domain: Execution

Error message

math.pow cannot raise to the exponent %s (%s)

In the message, %s marks a value that the engine fills in when it raises the error.

The story

Your script asked for a power, and rush said it cannot raise to that exponent. Let's see how it works. Math.pow is exact. A whole exponent, like three, is done by multiplying exactly, step by step. A fractional exponent, say one half, is read as a fraction, a p over q, and rush computes the q-th root of the p-th power. Exactness has a price. If the numerator or denominator of the exponent is enormous, the exact answer would be larger than any text the heap can hold. The limits are a numerator up to one hundred million, and a denominator up to one hundred thousand. Past that, there is no exact answer to give, and rush will not quietly hand you an approximation, because approximations are exactly what exact arithmetic exists to avoid. So it refuses, showing the exponent you gave and the bound in the two slots. Imagine writing two to the power of ten to the twelfth. The fix is to use a smaller exponent, or to restructure the math so the huge step is not needed. Stay within the bound, and every answer stays exact.

Text from the Rush engine's error catalogue.