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.Dd June 29, 2004 264f82cb46SDavid Schultz.Dt FDIM 3 274f82cb46SDavid Schultz.Os 284f82cb46SDavid Schultz.Sh NAME 294f82cb46SDavid Schultz.Nm fdim , 304f82cb46SDavid Schultz.Nm fdimf , 314f82cb46SDavid Schultz.Nm fdiml 324f82cb46SDavid Schultz.Nd positive difference functions 334f82cb46SDavid Schultz.Sh LIBRARY 344f82cb46SDavid Schultz.Lb libm 354f82cb46SDavid Schultz.Sh SYNOPSIS 364f82cb46SDavid Schultz.In math.h 374f82cb46SDavid Schultz.Ft double 384f82cb46SDavid Schultz.Fn fdim "double x" "double y" 394f82cb46SDavid Schultz.Ft float 404f82cb46SDavid Schultz.Fn fdimf "float x" "float y" 414f82cb46SDavid Schultz.Ft long double 424f82cb46SDavid Schultz.Fn fdiml "long double x" "long double y" 434f82cb46SDavid Schultz.Sh DESCRIPTION 444f82cb46SDavid SchultzThe 454f82cb46SDavid Schultz.Fn fdim , 464f82cb46SDavid Schultz.Fn fdimf , 474f82cb46SDavid Schultzand 484f82cb46SDavid Schultz.Fn fdiml 494f82cb46SDavid Schultzfunctions return the positive difference between 504f82cb46SDavid Schultz.Fa x 514f82cb46SDavid Schultzand 524f82cb46SDavid Schultz.Fa y . 534f82cb46SDavid SchultzThat is, if 544f82cb46SDavid Schultz.Fa x\- Ns Fa y 554f82cb46SDavid Schultzis positive, then 564f82cb46SDavid Schultz.Fa x\- Ns Fa y 574f82cb46SDavid Schultzis returned. 584f82cb46SDavid SchultzIf either 594f82cb46SDavid Schultz.Fa x 604f82cb46SDavid Schultzor 614f82cb46SDavid Schultz.Fa y 624f82cb46SDavid Schultzis an \*(Na, then an \*(Na is returned. 634f82cb46SDavid SchultzOtherwise, the result is 644f82cb46SDavid Schultz.Li +0.0 . 654f82cb46SDavid Schultz.Pp 66*c2025a76SJoel DahlOverflow or underflow may occur if the exact result is not 674f82cb46SDavid Schultzrepresentable in the return type. 684f82cb46SDavid SchultzNo other exceptions are raised. 694f82cb46SDavid Schultz.Sh SEE ALSO 704f82cb46SDavid Schultz.Xr fabs 3 , 714f82cb46SDavid Schultz.Xr fmax 3 , 724f82cb46SDavid Schultz.Xr fmin 3 , 734f82cb46SDavid Schultz.Xr math 3 744f82cb46SDavid Schultz.Sh STANDARDS 754f82cb46SDavid SchultzThe 764f82cb46SDavid Schultz.Fn fdim , 774f82cb46SDavid Schultz.Fn fdimf , 784f82cb46SDavid Schultzand 794f82cb46SDavid Schultz.Fn fdiml 804f82cb46SDavid Schultzfunctions conform to 814f82cb46SDavid Schultz.St -isoC-99 . 824f82cb46SDavid Schultz.Sh HISTORY 834f82cb46SDavid SchultzThese routines first appeared in 844f82cb46SDavid Schultz.Fx 5.3 . 85