Quote:
Originally Posted by Vince
That's for floats. There's nothing wrong with the function itself (although it can be written shorter, see below) so you probably placed it in the wrong spot.
PHP код:
stock abs(value)
return (value < 0) ? -value : value;
|
Yes, but you can use floatabs with integers as well. All you need to do is round it after getting it's absolute value.