Page 1 of 1

Exponent operator

Posted: 12 Oct 2016 18:37
by MURTUMA
I'm trying to convert following function to a format AM would understand. I can't seem to get exponent operator right.

How do I use pow() function correctly?

"-(x-240)^2/460+255"

Re: Exponent operator

Posted: 12 Oct 2016 19:14
by Martin
pow(base, exponent) should work:
val = -pow(x-240, 2)/460+255;

Regards,
Martin

Re: Exponent operator

Posted: 12 Oct 2016 20:33
by MURTUMA
Thanks. The problem seemed to be a wrong order of placement