Commit 4d37b872 authored by Stefan Silviu's avatar Stefan Silviu Committed by Alexandre Julliard

msvcrt: Implement nearbyint and nearbyintf.

parent 89d4e14c
...@@ -17130,6 +17130,8 @@ for ac_func in \ ...@@ -17130,6 +17130,8 @@ for ac_func in \
lrintf \ lrintf \
lround \ lround \
lroundf \ lroundf \
nearbyint \
nearbyintf \
powl \ powl \
remainder \ remainder \
remainderf \ remainderf \
......
...@@ -2554,6 +2554,8 @@ AC_CHECK_FUNCS(\ ...@@ -2554,6 +2554,8 @@ AC_CHECK_FUNCS(\
lrintf \ lrintf \
lround \ lround \
lroundf \ lroundf \
nearbyint \
nearbyintf \
powl \ powl \
remainder \ remainder \
remainderf \ remainderf \
......
...@@ -291,9 +291,9 @@ ...@@ -291,9 +291,9 @@
@ stub nan @ stub nan
@ stub nanf @ stub nanf
@ stub nanl @ stub nanl
@ stub nearbyint @ cdecl nearbyint(double) ucrtbase.nearbyint
@ stub nearbyintf @ cdecl nearbyintf(float) ucrtbase.nearbyintf
@ stub nearbyintl @ cdecl nearbyintl(double) ucrtbase.nearbyintl
@ cdecl nextafter(double double) ucrtbase.nextafter @ cdecl nextafter(double double) ucrtbase.nextafter
@ cdecl nextafterf(float float) ucrtbase.nextafterf @ cdecl nextafterf(float float) ucrtbase.nextafterf
@ cdecl nextafterl(double double) ucrtbase.nextafterl @ cdecl nextafterl(double double) ucrtbase.nextafterl
......
...@@ -2296,9 +2296,9 @@ ...@@ -2296,9 +2296,9 @@
@ stub nan @ stub nan
@ stub nanf @ stub nanf
@ stub nanl @ stub nanl
@ stub nearbyint @ cdecl nearbyint(double) MSVCRT_nearbyint
@ stub nearbyintf @ cdecl nearbyintf(float) MSVCRT_nearbyintf
@ stub nearbyintl @ cdecl nearbyintl(double) MSVCRT_nearbyint
@ cdecl nextafter(double double) MSVCRT__nextafter @ cdecl nextafter(double double) MSVCRT__nextafter
@ cdecl nextafterf(float float) MSVCRT__nextafterf @ cdecl nextafterf(float float) MSVCRT__nextafterf
@ cdecl nextafterl(double double) MSVCRT__nextafter @ cdecl nextafterl(double double) MSVCRT__nextafter
......
...@@ -1959,9 +1959,9 @@ ...@@ -1959,9 +1959,9 @@
@ stub nan @ stub nan
@ stub nanf @ stub nanf
@ stub nanl @ stub nanl
@ stub nearbyint @ cdecl nearbyint(double) msvcr120.nearbyint
@ stub nearbyintf @ cdecl nearbyintf(float) msvcr120.nearbyintf
@ stub nearbyintl @ cdecl nearbyintl(double) msvcr120.nearbyintl
@ cdecl nextafter(double double) msvcr120.nextafter @ cdecl nextafter(double double) msvcr120.nextafter
@ cdecl nextafterf(float float) msvcr120.nextafterf @ cdecl nextafterf(float float) msvcr120.nextafterf
@ cdecl nextafterl(double double) msvcr120.nextafterl @ cdecl nextafterl(double double) msvcr120.nextafterl
......
...@@ -1354,6 +1354,30 @@ double CDECL MSVCRT__yn(int order, double num) ...@@ -1354,6 +1354,30 @@ double CDECL MSVCRT__yn(int order, double num)
} }
/********************************************************************* /*********************************************************************
* _nearbyint (MSVCRT.@)
*/
double CDECL MSVCRT_nearbyint(double num)
{
#ifdef HAVE_NEARBYINT
return nearbyint(num);
#else
return num >= 0 ? floor(num + 0.5) : ceil(num - 0.5);
#endif
}
/*********************************************************************
* _nearbyintf (MSVCRT.@)
*/
float CDECL MSVCRT_nearbyintf(float num)
{
#ifdef HAVE_NEARBYINTF
return nearbyintf(num);
#else
return MSVCRT_nearbyint(num);
#endif
}
/*********************************************************************
* _nextafter (MSVCRT.@) * _nextafter (MSVCRT.@)
*/ */
double CDECL MSVCRT__nextafter(double num, double next) double CDECL MSVCRT__nextafter(double num, double next)
......
...@@ -2432,9 +2432,9 @@ ...@@ -2432,9 +2432,9 @@
@ stub nan @ stub nan
@ stub nanf @ stub nanf
@ stub nanl @ stub nanl
@ stub nearbyint @ cdecl nearbyint(double) MSVCRT_nearbyint
@ stub nearbyintf @ cdecl nearbyintf(float) MSVCRT_nearbyintf
@ stub nearbyintl @ cdecl nearbyintl(double) MSVCRT_nearbyint
@ cdecl nextafter(double double) MSVCRT__nextafter @ cdecl nextafter(double double) MSVCRT__nextafter
@ cdecl nextafterf(float float) MSVCRT__nextafterf @ cdecl nextafterf(float float) MSVCRT__nextafterf
@ cdecl nextafterl(double double) MSVCRT__nextafter @ cdecl nextafterl(double double) MSVCRT__nextafter
......
...@@ -564,6 +564,12 @@ ...@@ -564,6 +564,12 @@
/* Define to 1 if you have the <ncurses.h> header file. */ /* Define to 1 if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H #undef HAVE_NCURSES_H
/* Define to 1 if you have the `nearbyint' function. */
#undef HAVE_NEARBYINT
/* Define to 1 if you have the `nearbyintf' function. */
#undef HAVE_NEARBYINTF
/* Define to 1 if you have the <netdb.h> header file. */ /* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H #undef HAVE_NETDB_H
......
...@@ -148,6 +148,9 @@ float __cdecl fmodf(float, float); ...@@ -148,6 +148,9 @@ float __cdecl fmodf(float, float);
#define ldexpf(x,y) ((float)ldexp((double)(x),(y))) #define ldexpf(x,y) ((float)ldexp((double)(x),(y)))
double __cdecl nearbyint(double);
float __cdecl nearbyintf(float);
float __cdecl _hypotf(float, float); float __cdecl _hypotf(float, float);
int __cdecl _matherr(struct _exception*); int __cdecl _matherr(struct _exception*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment