simple question
#1

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?
Reply
#2

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.
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)