Thread: Absolute Value
View Single Post
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 12-31-2015 , 21:10   Re: Absolute Value
Reply With Quote #5

Quote:
Originally Posted by Potato Uno View Post
Double wat

PHP Code:
stock int IntAbs(int val)
{
   return (
val 0) ? -val val;

Tripple wat
PHP Code:
stock int IntAbs(int val)
{
    return 
IsGreaterThanZero(val) ? ReturnValue(val) : ReturnMinusValue(val);
}

static 
stock bool IsGreaterThanZero(int val)
{
    return (
val 0);
}

static 
stock int ReturnValue(int val)
{
    return 
val;
}

static 
stock int ReturnMinusValue(int val)
{
    return -
val;

__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline