MathPow Function
12345abc22: Hi this MathPow function keeps showing as 0, ideas? the negitive value is
MathPow(2.71828,-B/A);
Your information is insufficient to reach a conclusion. What are the values of "B" and "A" when it shows a result of 0?
If you put a -ve value for the power you are computing a smaller value - if B/A is a large negative value the result will be very small, even 0
Example:
PrintFormat("MathPow(2.71828, 5) = %.5f", MathPow(2.71828, 5)); PrintFormat("MathPow(2.71828, -5) = %.5f", MathPow(2.71828, -5)); PrintFormat("MathPow(2.71828, -50) = %.5f", MathPow(2.71828, -50));
Result:
2022.08.19 17:32:13.999 MathPow(2.71828, 5) = 148.41266
2022.08.19 17:32:13.999 MathPow(2.71828, -5) = 0.00674
2022.08.19 17:32:13.999 MathPow(2.71828, -50) = 0.00000
MathPow(2.71828,-B/(double)A);
MathPow(M_E, -B/(double)A);If one were to assume integer division causing a result of 0 for -B/A, then the result of MathPow, namely e^0, would be 1.0 and not 0.0.
thanks for the reply guys, i already worked this out myself, i have another question about mean equation on another thread.
Hi this MathPow function keeps showing as 0, ideas? the negitive value is