AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Is number negative or not? (https://forums.alliedmods.net/showthread.php?t=233641)

ZASTRELIS 01-18-2014 07:58

Is number negative or not?
 
How can find out is number negative or not?

YamiKaitou 01-18-2014 08:09

Re: Is number negative or not?
 
Check if it is less than 0

YamiKaitou 01-18-2014 08:13

Re: Is number negative or not?
 
Quote:

Originally Posted by WiggPerson (Post 2087606)
Code:

if(8) { // Your number
    // positive
} else {
    // negative
}

Or simply
Code:

if(!-1) {
    // negative
}


Won't work, any Non-Zero value will be considered True


All times are GMT -4. The time now is 10:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.