diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-09-05 23:03:38 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-09-05 23:03:47 +0200 |
| commit | 70ac1c4785fc1e158ab2349a962dba2526bf4fbc (patch) | |
| tree | bff270e2496dd284bccfc1271b43946f5d225224 /man/man3/isgreater.3 | |
| parent | 5423a6f86b2b920a5f3e8cf8d759b513050f2d33 (diff) | |
| download | man-pages-70ac1c4785fc1e158ab2349a962dba2526bf4fbc.tar.gz | |
src.mk, All pages: Move man* to man/
The root of the repository is becoming a bit overpopulated and
unorganized, due to the recent addition of more mandirs, and more
informative and configuration files too. Let's create a specific
mandir <man/> that contains the mandirs <man[1-8]*>.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man/man3/isgreater.3')
| -rw-r--r-- | man/man3/isgreater.3 | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/man/man3/isgreater.3 b/man/man3/isgreater.3 new file mode 100644 index 0000000000..73e9780f96 --- /dev/null +++ b/man/man3/isgreater.3 @@ -0,0 +1,144 @@ +.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\" +.\" SPDX-License-Identifier: GPL-1.0-or-later +.\" +.\" 2002-07-27 Walter Harms +.\" this was done with the help of the glibc manual +.\" +.TH ISGREATER 3 2021-03-22 "Linux man-pages (unreleased)" +.SH NAME +isgreater, isgreaterequal, isless, islessequal, islessgreater, +isunordered \- floating-point relational tests without exception for NaN +.SH LIBRARY +Math library +.RI ( libm ", " \-lm ) +.SH SYNOPSIS +.nf +.B #include <math.h> +.PP +.BI "int isgreater(" x ", " y ); +.BI "int isgreaterequal(" x ", " y ); +.BI "int isless(" x ", " y ); +.BI "int islessequal(" x ", " y ); +.BI "int islessgreater(" x ", " y ); +.BI "int isunordered(" x ", " y ); +.fi +.PP +.RS -4 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.RE +.PP +.nf + All functions described here: + _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L +.fi +.SH DESCRIPTION +The normal relational operations (like +.BR < , +"less than") +fail if one of the operands is NaN. +This will cause an exception. +To avoid this, C99 defines the macros listed below. +.PP +These macros are guaranteed to evaluate their arguments only once. +The arguments must be of real floating-point type (note: do not pass +integer values as arguments to these macros, since the arguments will +.I not +be promoted to real-floating types). +.TP +.BR isgreater () +determines \fI(x)\ >\ (y)\fP without an exception +if +.I x +or +.I y +is NaN. +.TP +.BR isgreaterequal () +determines \fI(x)\ >=\ (y)\fP without an exception +if +.I x +or +.I y +is NaN. +.TP +.BR isless () +determines \fI(x)\ <\ (y)\fP without an exception +if +.I x +or +.I y +is NaN. +.TP +.BR islessequal () +determines \fI(x)\ <=\ (y)\fP without an exception +if +.I x +or +.I y +is NaN. +.TP +.BR islessgreater () +determines \fI(x)\ < (y) || (x) >\ (y)\fP +without an exception if +.I x +or +.I y +is NaN. +This macro is not equivalent to \fIx\ !=\ y\fP because that expression is +true if +.I x +or +.I y +is NaN. +.TP +.BR isunordered () +determines whether its arguments are unordered, that is, whether +at least one of the arguments is a NaN. +.SH RETURN VALUE +The macros other than +.BR isunordered () +return the result of the relational comparison; +these macros return 0 if either argument is a NaN. +.PP +.BR isunordered () +returns 1 if +.I x +or +.I y +is NaN and 0 otherwise. +.SH ERRORS +No errors occur. +.SH ATTRIBUTES +For an explanation of the terms used in this section, see +.BR attributes (7). +.ad l +.nh +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.BR isgreater (), +.BR isgreaterequal (), +.BR isless (), +.BR islessequal (), +.BR islessgreater (), +.BR isunordered () +T} Thread safety MT-Safe +.TE +.hy +.ad +.sp 1 +.SH STANDARDS +POSIX.1-2001, POSIX.1-2008, C99. +.SH NOTES +Not all hardware supports these functions, +and where hardware support isn't provided, they will be emulated by macros. +This will result in a performance penalty. +Don't use these functions if NaN is of no concern for you. +.SH SEE ALSO +.BR fpclassify (3), +.BR isnan (3) |
