xref: /dflybsd-src/contrib/openbsd_libm/man/fdim.3 (revision 4382f29d99a100bd77a81697c2f699c11f6a472a)
1*05a0b428SJohn Marino.\"	$OpenBSD: fdim.3,v 1.2 2011/07/07 01:34:52 martynas Exp $
2*05a0b428SJohn Marino.\"
3*05a0b428SJohn Marino.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
4*05a0b428SJohn Marino.\" All rights reserved.
5*05a0b428SJohn Marino.\"
6*05a0b428SJohn Marino.\" Redistribution and use in source and binary forms, with or without
7*05a0b428SJohn Marino.\" modification, are permitted provided that the following conditions
8*05a0b428SJohn Marino.\" are met:
9*05a0b428SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
10*05a0b428SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
11*05a0b428SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
12*05a0b428SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
13*05a0b428SJohn Marino.\"    documentation and/or other materials provided with the distribution.
14*05a0b428SJohn Marino.\"
15*05a0b428SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*05a0b428SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*05a0b428SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*05a0b428SJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*05a0b428SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*05a0b428SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*05a0b428SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*05a0b428SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*05a0b428SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*05a0b428SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*05a0b428SJohn Marino.\" SUCH DAMAGE.
26*05a0b428SJohn Marino.\"
27*05a0b428SJohn Marino.\" $FreeBSD: src/lib/msun/man/fdim.3,v 1.1 2004/06/30 07:04:01 das Exp $
28*05a0b428SJohn Marino.\"
29*05a0b428SJohn Marino.Dd $Mdocdate: July 7 2011 $
30*05a0b428SJohn Marino.Dt FDIM 3
31*05a0b428SJohn Marino.Os
32*05a0b428SJohn Marino.Sh NAME
33*05a0b428SJohn Marino.Nm fdim ,
34*05a0b428SJohn Marino.Nm fdimf ,
35*05a0b428SJohn Marino.Nm fdiml
36*05a0b428SJohn Marino.Nd positive difference functions
37*05a0b428SJohn Marino.Sh SYNOPSIS
38*05a0b428SJohn Marino.In math.h
39*05a0b428SJohn Marino.Ft double
40*05a0b428SJohn Marino.Fn fdim "double x" "double y"
41*05a0b428SJohn Marino.Ft float
42*05a0b428SJohn Marino.Fn fdimf "float x" "float y"
43*05a0b428SJohn Marino.Ft long double
44*05a0b428SJohn Marino.Fn fdiml "long double x" "long double y"
45*05a0b428SJohn Marino.Sh DESCRIPTION
46*05a0b428SJohn MarinoThe
47*05a0b428SJohn Marino.Fn fdim ,
48*05a0b428SJohn Marino.Fn fdimf ,
49*05a0b428SJohn Marinoand
50*05a0b428SJohn Marino.Fn fdiml
51*05a0b428SJohn Marinofunctions return the positive difference between
52*05a0b428SJohn Marino.Fa x
53*05a0b428SJohn Marinoand
54*05a0b428SJohn Marino.Fa y .
55*05a0b428SJohn MarinoThat is, if
56*05a0b428SJohn Marino.Fa x\- Ns Fa y
57*05a0b428SJohn Marinois positive, then
58*05a0b428SJohn Marino.Fa x\- Ns Fa y
59*05a0b428SJohn Marinois returned.
60*05a0b428SJohn MarinoIf either
61*05a0b428SJohn Marino.Fa x
62*05a0b428SJohn Marinoor
63*05a0b428SJohn Marino.Fa y
64*05a0b428SJohn Marinois an \*(Na, then an \*(Na is returned.
65*05a0b428SJohn MarinoOtherwise, the result is
66*05a0b428SJohn Marino.Li +0.0 .
67*05a0b428SJohn Marino.Pp
68*05a0b428SJohn MarinoOverflow or underflow may occur if the exact result is not
69*05a0b428SJohn Marinorepresentable in the return type.
70*05a0b428SJohn MarinoNo other exceptions are raised.
71*05a0b428SJohn Marino.Sh SEE ALSO
72*05a0b428SJohn Marino.Xr fabs 3 ,
73*05a0b428SJohn Marino.Xr fmax 3 ,
74*05a0b428SJohn Marino.Xr fmin 3
75*05a0b428SJohn Marino.Sh STANDARDS
76*05a0b428SJohn MarinoThe
77*05a0b428SJohn Marino.Fn fdim ,
78*05a0b428SJohn Marino.Fn fdimf ,
79*05a0b428SJohn Marinoand
80*05a0b428SJohn Marino.Fn fdiml
81*05a0b428SJohn Marinofunctions conform to
82*05a0b428SJohn Marino.St -isoC-99 .
83*05a0b428SJohn Marino.Sh HISTORY
84*05a0b428SJohn MarinoThese routines first appeared in
85*05a0b428SJohn Marino.Ox 4.5 .
86