Arma Math

SchwEde

OpenDayZ Rockstar!
hey guys,

hope one of you can help me. I dont know how i can write this formula right in arma:
Code:
(x-1)^1

thanks
 
It looks fine as it is. If that is not working try:

Code:
_exponent = 1;
_reciprocal = (x - 1);
if (_reciprocal > 0) {
_result = _reciprocal ^ _exponent;
} else {
hint "Reciprocal was negative! Try applying a negative exponent instead!";
};

I dont think ARMA, or many math libs for that matter can apply exponents to a negative number. The exponent however - can be negative. This is effectively functional division.

See: http://community.bistudio.com/wiki/a_^_b
Also: http://www.mathsisfun.com/algebra/negative-exponents.html
 
Back
Top