xref: /netbsd-src/lib/libm/man/fdim.3 (revision d4a6f9b0980ed99b197fdc91783e4fad04f81fa9)
126573d88Schristos.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org>
226573d88Schristos.\" All rights reserved.
326573d88Schristos.\"
426573d88Schristos.\" Redistribution and use in source and binary forms, with or without
526573d88Schristos.\" modification, are permitted provided that the following conditions
626573d88Schristos.\" are met:
726573d88Schristos.\" 1. Redistributions of source code must retain the above copyright
826573d88Schristos.\"    notice, this list of conditions and the following disclaimer.
926573d88Schristos.\" 2. Redistributions in binary form must reproduce the above copyright
1026573d88Schristos.\"    notice, this list of conditions and the following disclaimer in the
1126573d88Schristos.\"    documentation and/or other materials provided with the distribution.
1226573d88Schristos.\"
1326573d88Schristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1426573d88Schristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1526573d88Schristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1626573d88Schristos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1726573d88Schristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1826573d88Schristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1926573d88Schristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2026573d88Schristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2126573d88Schristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2226573d88Schristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2326573d88Schristos.\" SUCH DAMAGE.
2426573d88Schristos.\"
2526573d88Schristos.\" $FreeBSD: src/lib/msun/man/fdim.3,v 1.1 2004/06/30 07:04:01 das Exp $
26*d4a6f9b0Ssnj.\" $NetBSD: fdim.3,v 1.3 2010/03/08 02:35:50 snj Exp $
2726573d88Schristos.\"
2826573d88Schristos.Dd June 29, 2004
2926573d88Schristos.Dt FDIM 3
3026573d88Schristos.Os
3126573d88Schristos.Sh NAME
3226573d88Schristos.Nm fdim ,
3326573d88Schristos.Nm fdimf ,
3426573d88Schristos.Nm fdiml
3526573d88Schristos.Nd positive difference functions
3626573d88Schristos.Sh LIBRARY
3726573d88Schristos.Lb libm
3826573d88Schristos.Sh SYNOPSIS
3926573d88Schristos.In math.h
4026573d88Schristos.Ft double
4126573d88Schristos.Fn fdim "double x" "double y"
4226573d88Schristos.Ft float
4326573d88Schristos.Fn fdimf "float x" "float y"
4426573d88Schristos.Ft long double
4526573d88Schristos.Fn fdiml "long double x" "long double y"
4626573d88Schristos.Sh DESCRIPTION
4726573d88SchristosThe
4826573d88Schristos.Fn fdim ,
4926573d88Schristos.Fn fdimf ,
5026573d88Schristosand
5126573d88Schristos.Fn fdiml
5226573d88Schristosfunctions return the positive difference between
5326573d88Schristos.Fa x
5426573d88Schristosand
5526573d88Schristos.Fa y .
5626573d88SchristosThat is, if
5726573d88Schristos.Fa x\- Ns Fa y
5826573d88Schristosis positive, then
5926573d88Schristos.Fa x\- Ns Fa y
6026573d88Schristosis returned.
6126573d88SchristosIf either
6226573d88Schristos.Fa x
6326573d88Schristosor
6426573d88Schristos.Fa y
6526573d88Schristosis an \*(Na, then an \*(Na is returned.
6626573d88SchristosOtherwise, the result is
6726573d88Schristos.Li +0.0 .
6826573d88Schristos.Pp
6926573d88SchristosOverflow or underflow may occur iff the exact result is not
7026573d88Schristosrepresentable in the return type.
7126573d88SchristosNo other exceptions are raised.
7226573d88Schristos.Sh SEE ALSO
7326573d88Schristos.Xr fabs 3 ,
7426573d88Schristos.Xr fmax 3 ,
7526573d88Schristos.Xr fmin 3 ,
7626573d88Schristos.Xr math 3
7726573d88Schristos.Sh STANDARDS
7826573d88SchristosThe
7926573d88Schristos.Fn fdim ,
8026573d88Schristos.Fn fdimf ,
8126573d88Schristosand
8226573d88Schristos.Fn fdiml
8326573d88Schristosfunctions conform to
8426573d88Schristos.St -isoC-99 .
8526573d88Schristos.Sh HISTORY
8626573d88SchristosThese routines first appeared in
8700f6672dSwiz.Fx 5.3
8800f6672dSwizand
89*d4a6f9b0Ssnj.Nx 5.1 .
90