14f82cb46SDavid Schultz.\" Copyright (c) 2004 David Schultz <das@FreeBSD.org> 24f82cb46SDavid Schultz.\" All rights reserved. 34f82cb46SDavid Schultz.\" 44f82cb46SDavid Schultz.\" Redistribution and use in source and binary forms, with or without 54f82cb46SDavid Schultz.\" modification, are permitted provided that the following conditions 64f82cb46SDavid Schultz.\" are met: 74f82cb46SDavid Schultz.\" 1. Redistributions of source code must retain the above copyright 84f82cb46SDavid Schultz.\" notice, this list of conditions and the following disclaimer. 94f82cb46SDavid Schultz.\" 2. Redistributions in binary form must reproduce the above copyright 104f82cb46SDavid Schultz.\" notice, this list of conditions and the following disclaimer in the 114f82cb46SDavid Schultz.\" documentation and/or other materials provided with the distribution. 124f82cb46SDavid Schultz.\" 134f82cb46SDavid Schultz.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 144f82cb46SDavid Schultz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 154f82cb46SDavid Schultz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 164f82cb46SDavid Schultz.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 174f82cb46SDavid Schultz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 184f82cb46SDavid Schultz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 194f82cb46SDavid Schultz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 204f82cb46SDavid Schultz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 214f82cb46SDavid Schultz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 224f82cb46SDavid Schultz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 234f82cb46SDavid Schultz.\" SUCH DAMAGE. 244f82cb46SDavid Schultz.\" 254f82cb46SDavid Schultz.\" $FreeBSD$ 264f82cb46SDavid Schultz.\" 274f82cb46SDavid Schultz.Dd June 29, 2004 284f82cb46SDavid Schultz.Dt FDIM 3 294f82cb46SDavid Schultz.Os 304f82cb46SDavid Schultz.Sh NAME 314f82cb46SDavid Schultz.Nm fdim , 324f82cb46SDavid Schultz.Nm fdimf , 334f82cb46SDavid Schultz.Nm fdiml 344f82cb46SDavid Schultz.Nd positive difference functions 354f82cb46SDavid Schultz.Sh LIBRARY 364f82cb46SDavid Schultz.Lb libm 374f82cb46SDavid Schultz.Sh SYNOPSIS 384f82cb46SDavid Schultz.In math.h 394f82cb46SDavid Schultz.Ft double 404f82cb46SDavid Schultz.Fn fdim "double x" "double y" 414f82cb46SDavid Schultz.Ft float 424f82cb46SDavid Schultz.Fn fdimf "float x" "float y" 434f82cb46SDavid Schultz.Ft long double 444f82cb46SDavid Schultz.Fn fdiml "long double x" "long double y" 454f82cb46SDavid Schultz.Sh DESCRIPTION 464f82cb46SDavid SchultzThe 474f82cb46SDavid Schultz.Fn fdim , 484f82cb46SDavid Schultz.Fn fdimf , 494f82cb46SDavid Schultzand 504f82cb46SDavid Schultz.Fn fdiml 514f82cb46SDavid Schultzfunctions return the positive difference between 524f82cb46SDavid Schultz.Fa x 534f82cb46SDavid Schultzand 544f82cb46SDavid Schultz.Fa y . 554f82cb46SDavid SchultzThat is, if 564f82cb46SDavid Schultz.Fa x\- Ns Fa y 574f82cb46SDavid Schultzis positive, then 584f82cb46SDavid Schultz.Fa x\- Ns Fa y 594f82cb46SDavid Schultzis returned. 604f82cb46SDavid SchultzIf either 614f82cb46SDavid Schultz.Fa x 624f82cb46SDavid Schultzor 634f82cb46SDavid Schultz.Fa y 644f82cb46SDavid Schultzis an \*(Na, then an \*(Na is returned. 654f82cb46SDavid SchultzOtherwise, the result is 664f82cb46SDavid Schultz.Li +0.0 . 674f82cb46SDavid Schultz.Pp 684f82cb46SDavid SchultzOverflow or underflow may occur iff the exact result is not 694f82cb46SDavid Schultzrepresentable in the return type. 704f82cb46SDavid SchultzNo other exceptions are raised. 714f82cb46SDavid Schultz.Sh SEE ALSO 724f82cb46SDavid Schultz.Xr fabs 3 , 734f82cb46SDavid Schultz.Xr fmax 3 , 744f82cb46SDavid Schultz.Xr fmin 3 , 754f82cb46SDavid Schultz.Xr math 3 764f82cb46SDavid Schultz.Sh STANDARDS 774f82cb46SDavid SchultzThe 784f82cb46SDavid Schultz.Fn fdim , 794f82cb46SDavid Schultz.Fn fdimf , 804f82cb46SDavid Schultzand 814f82cb46SDavid Schultz.Fn fdiml 824f82cb46SDavid Schultzfunctions conform to 834f82cb46SDavid Schultz.St -isoC-99 . 844f82cb46SDavid Schultz.Sh HISTORY 854f82cb46SDavid SchultzThese routines first appeared in 864f82cb46SDavid Schultz.Fx 5.3 . 87