SA-MP Forums Archive
simple question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: simple question (/showthread.php?tid=285129)



simple question - TheArcher - 22.09.2011

Hi guys. I was testing something and i think it's wrong?..

I tried to do a math equation like this:

(3)^3...is not equal to 3*3*3? Beacuse it prints "0".

my code was

new test2[MAX_PLAYERS];

under onplayerconnect to check the vaules in message and print.

so i did test2[playerid] = (3)^3 but in game prints 0 and in server_log 0 too. is that an error or in PAWN (3)^3 is not equal to 3*3*3?


Re: simple question - Vince - 22.09.2011

The ^ is not the symbol for 'power' in Pawn, it's the symbol for bitwise exclusive-or. If you need to use a power of two, you can multiply the value with itself. Else you'd need to use floatpower.


Re: simple question - TheArcher - 22.09.2011

Quote:
Originally Posted by Vince
Посмотреть сообщение
The ^ is not the symbol for 'power' in Pawn, it's the symbol for bitwise exclusive-or. If you need to use a power of two, you can multiply the value with itself. Else you'd need to use floatpower.
Yes, i know i can use floatpower but i thought "^" symbol was to power.