Last change
on this file since 351 was 337, checked in by coas-nagasima, 6 years ago |
ASP3版ECNLを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
406 bytes
|
Line | |
---|
1 | #include <math.h>
|
---|
2 | #include <float.h>
|
---|
3 |
|
---|
4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
---|
5 | long double nearbyintl(long double x)
|
---|
6 | {
|
---|
7 | return nearbyint(x);
|
---|
8 | }
|
---|
9 | #else
|
---|
10 | #include <fenv.h>
|
---|
11 | long double nearbyintl(long double x)
|
---|
12 | {
|
---|
13 | #ifdef FE_INEXACT
|
---|
14 | #pragma STDC FENV_ACCESS ON
|
---|
15 | int e;
|
---|
16 |
|
---|
17 | e = fetestexcept(FE_INEXACT);
|
---|
18 | #endif
|
---|
19 | x = rintl(x);
|
---|
20 | #ifdef FE_INEXACT
|
---|
21 | if (!e)
|
---|
22 | feclearexcept(FE_INEXACT);
|
---|
23 | #endif
|
---|
24 | return x;
|
---|
25 | }
|
---|
26 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.