Module
#1

Hi,

What sa-mp function make a number like -5 to a positive number? like |-5|=5
Reply
#2

pawn Код:
stock PositiveConversion(val)
{
    if(val < 0) val *= -1;
    return val;
}
Reply
#3

https://sampwiki.blast.hk/wiki/Floatabs
Reply
#4

i think there a function named sqr or sqrt ... ******
Reply
#5

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
That will work for float, but what about integer? Check if the number is negative, and then mulitple it with -1.

Код:
if(number < 0)
{
number = number * (-1);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)