this repo has no description
1.\" Copyright (c) 2008 Apple Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" from: @(#)nexttoward.3 1.0 2008/07/02
28.\"
29.Dd July 02, 2008
30.Dt NEXTTOWARD 3
31.Os
32.Sh NAME
33.Nm nexttoward
34.Sh SYNOPSIS
35.Fd #include <math.h>
36.Ft double
37.Fn nexttoward "double x" "long double y"
38.Ft long double
39.Fn nexttowardl "long double x" "long double y"
40.Ft float
41.Fn nexttoward "float x" "long double y"
42.Sh DESCRIPTION
43The
44.Fn nexttoward
45functions return the next machine representable number from
46.Fa x
47in direction of
48.Fa y .
49It is identical to
50.Fn nextafter
51except that the second parameter has type long double, and the function returns
52.Fa y
53converted to the type of the function if
54.Fa x
55and
56.Fa y
57are equal.
58.Sh SPECIAL VALUES
59.Fn nexttoward "x" "y"
60raises the "overflow" and "inexact" floating-point exceptions for x finite and the function value infinite.
61.Pp
62.Fn nexttoward "x" "y"
63raises the "underflow" and "inexact" floating-point exceptions for the function value subnormal or zero and x not equal to y.
64.Sh SEE ALSO
65.Xr nextafter 3
66.Xr math 3
67.Sh STANDARDS
68The
69.Fn nexttoward
70functions conform to ISO/IEC 9899:1999(E).