Rev 4872 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * ==================================================== |
||
3 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
||
4 | * |
||
5 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
||
6 | * Permission to use, copy, modify, and distribute this |
||
7 | * software is freely granted, provided that this notice |
||
8 | * is preserved. |
||
9 | * ==================================================== |
||
10 | */ |
||
11 | /* |
||
12 | FUNCTION |
||
13 | < |
||
14 | INDEX |
||
15 | nearbyint |
||
16 | INDEX |
||
17 | nearbyintf |
||
18 | |||
19 | ANSI_SYNOPSIS |
||
20 | #include |
||
21 | double nearbyint(double <[x]>); |
||
22 | float nearbyintf(float <[x]>); |
||
23 | |||
24 | DESCRIPTION |
||
25 | The < |
||
26 | floating-point format, using the current rounding direction and |
||
27 | (supposedly) without raising the "inexact" floating-point exception. |
||
28 | See the < |
||
29 | floating-point exception being raised when appropriate. |
||
30 | |||
31 | BUGS |
||
32 | Newlib does not support the floating-point exception model, so that |
||
33 | the floating-point exception control is not present and thereby what may |
||
34 | be seen will be compiler and hardware dependent in this regard. |
||
35 | The Newlib < |
||
36 | functions with respect to the floating-point exception behavior, and |
||
37 | will cause the "inexact" exception to be raised for most targets. |
||
38 | |||
39 | RETURNS |
||
40 | <[x]> rounded to an integral value, using the current rounding direction. |
||
41 | |||
42 | PORTABILITY |
||
43 | ANSI C, POSIX |
||
44 | |||
45 | SEEALSO |
||
46 | < |
||
47 | */ |
||
48 | |||
49 | #include |
||
50 | #include "fdlibm.h" |
||
51 | |||
52 | #ifndef _DOUBLE_IS_32BITS |
||
53 | |||
54 | #ifdef __STDC__ |
||
55 | double nearbyint(double x) |
||
56 | #else |
||
57 | double nearbyint(x) |
||
58 | double x; |
||
59 | #endif |
||
60 | { |
||
61 | return rint(x); |
||
62 | } |
||
63 | |||
64 | #endif /* _DOUBLE_IS_32BITS */ |