-
Notifications
You must be signed in to change notification settings - Fork 9
Description
The current implementation of the Theta.Math.pow() function has several limitations and issues:
Negative Exponents: The function does not handle negative exponents properly, such as 10**-5. We need to check the sign of the exponent and perform division if the exponent is negative.
Negative Base Values: The function does not handle negative base values correctly. For negative bases, we need to multiply by the absolute value of the base to get the correct result.
Floating Point Exponents: The function does not handle floating point exponents. It might be beneficial to split this internally into a powf (for floating-point exponents) and pow (for integer exponents) function to improve efficiency. This change will also require detecting and storing whether a number is an integer or a float in the lexer and subsequently in the ASTNode.