--- uClibc-0.9.27/libm/float_wrappers.c.nexttoward 2005-03-12 17:07:29 +0100 +++ uClibc-0.9.27/libm/float_wrappers.c 2005-03-12 17:15:56 +0100 @@ -24,12 +24,6 @@ #include "math.h" -/* For the time being, do _NOT_ implement these functions - * that are defined by SuSv3 */ -#if 0 -float nexttowardf(float, long double); -#endif - /* Implement the following, as defined by SuSv3 */ #if 0 float acosf(float); @@ -73,6 +67,7 @@ float modff(float, float *); float nearbyintf(float); float nextafterf(float, float); +float nexttowardf(float, long double); float powf(float, float); float remainderf(float, float); float remquof(float, float, int *); @@ -420,14 +415,13 @@ #endif -#if 0 #ifdef L_nexttowardf float nexttowardf (float x, long double y) { return (float) nexttoward( (double)x, (double)y ); } #endif -#endif + #ifdef L_powf float powf (float x, float y) --- uClibc-0.9.27/libm/Makefile.nexttoward 2005-03-12 17:13:41 +0100 +++ uClibc-0.9.27/libm/Makefile 2005-03-12 17:22:40 +0100 @@ -68,8 +68,8 @@ w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cabs.c\ w_cosh.c w_drem.c w_exp.c w_exp2.c w_fmod.c w_gamma.c w_gamma_r.c\ w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c\ - w_log.c w_log2.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c\ - w_sqrt.c w_tgamma.c fpmacros.c nan.c + w_log.c w_log2.c w_log10.c w_nexttoward.c w_pow.c w_remainder.c\ + w_scalb.c w_sinh.c w_sqrt.c w_tgamma.c fpmacros.c nan.c FL_MOBJ = acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \ --- uClibc-0.9.27/libm/ldouble_wrappers.c.nexttoward 2005-03-12 17:14:39 +0100 +++ uClibc-0.9.27/libm/ldouble_wrappers.c 2005-03-12 17:15:42 +0100 @@ -24,12 +24,6 @@ #include "math.h" -/* For the time being, do _NOT_ implement these functions - * that are defined by SuSv3 */ -#if 0 -long double nexttowardl(long double, long double); -#endif - /* Implement the following, as defined by SuSv3 */ #if 0 long double acoshl(long double); @@ -73,6 +67,7 @@ long double modfl(long double, long double *); long double nearbyintl(long double); long double nextafterl(long double, long double); +long double nexttowardl(long double, long double); long double powl(long double, long double); long double remainderl(long double, long double); long double remquol(long double, long double, int *); @@ -420,14 +415,13 @@ #endif -#if 0 #ifdef L_nexttowardl long double nexttowardl (long double x, long double y) { return (long double) nexttoward( (double)x, (double)y ); } #endif -#endif + #ifdef L_powl long double powl (long double x, long double y) --- uClibc-0.9.27/libm/w_nexttoward.c.nexttoward 2005-03-12 17:24:23 +0100 +++ uClibc-0.9.27/libm/w_nexttoward.c 2005-03-12 17:20:38 +0100 @@ -0,0 +1,29 @@ +/* vi: set sw=4 ts=4: */ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + * for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ +double nexttoward(double x, long double y) +#else +double nexttoward(x,y) + double x; long double y; +#endif +{ + return (double) nextafter( (double)x, (double)y ); +}