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 13 #include <math.h> 14 #include "fdlibm.h" 15 16 #ifdef __STDC__ nearbyintf(float x)17 float nearbyintf(float x) 18 #else 19 float nearbyintf(x) 20 float x; 21 #endif 22 { 23 return rintf(x); 24 } 25 26 #ifdef _DOUBLE_IS_32BITS 27 28 #ifdef __STDC__ nearbyint(double x)29 double nearbyint(double x) 30 #else 31 double nearbyint(x) 32 double x; 33 #endif 34 { 35 return (double) nearbyintf((float) x); 36 } 37 38 #endif /* defined(_DOUBLE_IS_32BITS) */ 39