File: fdim.3

package info (click to toggle)
manpages 4.10-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,464 kB
  • ctags: 5
  • sloc: sh: 435; python: 166; makefile: 75; lisp: 22
file content (103 lines) | stat: -rw-r--r-- 2,242 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.\" Copyright 2003 Walter Harms, Andries Brouwer
.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
.\"     <mtk.manpages@gmail.com>
.\"
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
.\" Distributed under GPL
.\" %%%LICENSE_END
.\"
.TH FDIM 3 2016-03-15 "" "Linux Programmer's Manual"
.SH NAME
fdim, fdimf, fdiml \- positive difference
.SH SYNOPSIS
.B #include <math.h>
.sp
.BI "double fdim(double " x ", double " y );
.br
.BI "float fdimf(float " x ", float " y );
.br
.BI "long double fdiml(long double " x ", long double " y );
.sp
Link with \fI\-lm\fP.
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.ad l
.BR fdimf (),
.BR fdiml ():
.RS 4
_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
.RE
.ad
.SH DESCRIPTION
These functions return the positive difference, max(\fIx\fP-\fIy\fP,0),
between their arguments.
.SH RETURN VALUE
On success, these functions return the positive difference.

If
.I x
or
.I y
is a NaN, a NaN is returned.

If the result overflows,
a range error occurs,
and the functions return
.BR HUGE_VAL ,
.BR HUGE_VALF ,
or
.BR HUGE_VALL ,
respectively.
.SH ERRORS
See
.BR math_error (7)
for information on how to determine whether an error has occurred
when calling these functions.
.PP
The following errors can occur:
.TP
Range error: result overflow
.\" .I errno
.\" is set to
.\" .BR ERANGE .
An overflow floating-point exception
.RB ( FE_OVERFLOW )
is raised.
.PP
These functions do not set
.IR errno .
.\" FIXME . Is it intentional that these functions do not set errno?
.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6796
.SH VERSIONS
These functions first appeared in glibc in version 2.1.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lbw24 lb lb
l l l.
Interface	Attribute	Value
T{
.BR fdim (),
.BR fdimf (),
.BR fdiml ()
T}	Thread safety	MT-Safe
.TE
.SH CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008.
.SH SEE ALSO
.BR fmax (3)
.SH COLOPHON
This page is part of release 4.10 of the Linux
.I man-pages
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
\%https://www.kernel.org/doc/man\-pages/.