SA-MP Power of a number.
#1

How do i calculate a power of x number in pawno? using ^ doesn't work.

This gives some odd kind of results. I am trying something like (x^2)*10.

It should have give these
x=1 - 10.
x=2 - 40.
x=3 - 90.

But instead it gives
x=1 - 30
x=2 - 0
x=3 - 10

This looks like '^' is acting as -2.

Code I used to test it
Код:
printf("%d",(1^2)*10);
	printf("%d",(2^2)*10);
	printf("%d",(3^2)*10);
Reply


Messages In This Thread
SA-MP Power of a number. - by AroseKhanNiazi - 21.12.2016, 15:36
Re: SA-MP Power of a number. - by Jochemd - 21.12.2016, 15:41
Re: SA-MP Power of a number. - by Konstantinos - 21.12.2016, 16:00
Re: SA-MP Power of a number. - by Vince - 21.12.2016, 16:27
Re: SA-MP Power of a number. - by AroseKhanNiazi - 21.12.2016, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)