ABS(3) 1 ABS(3)abs - Absolute valueSYNOPSIS
number abs (mixed $number)
DESCRIPTION
Returns the absolute value of $number.
PARAMETERS
o $number
- The numeric value to process
RETURN VALUES
The absolute value of $number. If the argument $number is of type float, the return type is also float, otherwise it is integer (as float
usually has a bigger value range than integer).
EXAMPLES
Example #1
abs(3) example
<?php
echo abs(-4.2); // 4.2 (double/float)
echo abs(5); // 5 (integer)
echo abs(-5); // 5 (integer)
?>
SEE ALSO gmp_abs(3), gmp_sign(3).
PHP Documentation Group ABS(3)
Check Out this Related Man Page
ABS(3) Linux Programmer's Manual ABS(3)NAME
abs, labs, llabs, imaxabs - compute the absolute value of an integer
SYNOPSIS
#include <stdlib.h>
int abs(int j);
long int labs(long int j);
long long int llabs(long long int j);
#include <inttypes.h>
intmax_t imaxabs(intmax_t j);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
llabs():
_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
or cc -std=c99
DESCRIPTION
The abs() function computes the absolute value of the integer argument j. The labs(), llabs() and imaxabs() functions compute the absolute
value of the argument j of the appropriate integer type for the function.
RETURN VALUE
Returns the absolute value of the integer argument, of the appropriate integer type for the function.
ATTRIBUTES
Multithreading (see pthreads(7))
The abs(), labs(), llabs(), and imaxabs() functions are thread-safe.
CONFORMING TO
SVr4, POSIX.1-2001, 4.3BSD, C99. C89 only includes the abs() and labs() functions; the functions llabs() and imaxabs() were added in C99.
NOTES
Trying to take the absolute value of the most negative integer is not defined.
The llabs() function is included in glibc since version 2.0, but is not in libc5 or libc4. The imaxabs() function is included in glibc
since version 2.1.1.
For llabs() to be declared, it may be necessary to define _ISOC99_SOURCE or _ISOC9X_SOURCE (depending on the version of glibc) before
including any standard headers.
GCC handles abs() and labs() as built-in functions. GCC 3.0 also handles llabs() and imaxabs() as built-ins.
SEE ALSO cabs(3), ceil(3), fabs(3), floor(3), rint(3)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2013-06-21 ABS(3)
I'm sure this is pretty infantile but I can't figute it out.
How to I load the nVidia driver for SuSE 9.2? I have no idea what the X environment is or how to quit it or how to run the nVidia patch.
Secondly how do I persuade my SuSE 9.3 computer to talk with my Windows XP network.
Linux... (9 Replies)
hi all,
can i get script find file & copy that file with path
for an example
sourse : /home/abc/
destination : /home/backup/
files which need to find : tmp*
copy these files with its absolute path inside
like :- /home/abc/x/y/z/tmp.txt to /home/backup/date/x/y/z/tmp.txt
thanks in... (15 Replies)
Hi Everyone,
I need to invoke the dumpstabs utility on Solaris 10.
OS details :
SunOS frtsunserver 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440
when i key in the command dumpstabs -v it says "dumpstabs not found. (13 Replies)
I have a script in which i want to print absolute path of the same script irrespective of path from where i run script.
I am using
test.sh:
echo "pwd : `pwd`"
echo "script name: $0"
echo "dirname: `dirname $0`"
when i run script from /my/test/dir/struct as ../test.sh the output i... (10 Replies)
Hi,
How can I extract parts from an absolute path?
For example :
The absolute path is /dir1/dir2/dir3/dir4/dir5.I need the relative path starting with directory given as parameter : for instance if the parameter is dir3 then the result should be dir3/dir4/dir5
I need generic solution... (9 Replies)
hi buddies;
i have a file.txt:
Note: All the seperators are SPACE.
192.168.1.1
ParameterObject=1 Speech 1
ParameterObject=2 Speech 1
192.168.1.1
ParamFunction=1 UserID 1 (DEACTIVATED)
Sector=1,Device=2,Unit=3 DeviceId 1
192.168.1.1
FeederCable=2B ... (18 Replies)
Hi,
I'm looking for a command that replaces spaces/tabs with pipe symbol and store the result to the same file instead of routing it to another file.
infile
outfile
Thanks. (11 Replies)
Hello all,
I have an unstructured file with space as delimiter , which I want to structure.
The output file should actually have only 5 columns with tab as delimiter.
The 4th column can have only 3 values ( biological_process , cellular_component , molecular_function )
Here is how the... (12 Replies)