Return to s_roundf.c CVS log | Up to [cvs.NetBSD.org] / src / lib / libm / src |
Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. |
version 1.1, 2004/07/10 13:49:10 | version 1.2, 2007/08/21 20:10:27 | ||
---|---|---|---|
|
|
||
return (x); | return (x); | ||
if (x >= 0.0) { | if (x >= 0.0) { | ||
t = ceilf(x); | t = floorf(x); | ||
if (t - x > 0.5) | if (x - t >= 0.5) | ||
t -= 1.0; | t += 1.0; | ||
return (t); | return (t); | ||
} else { | } else { | ||
t = ceilf(-x); | x = -x; | ||
if (t + x > 0.5) | t = floorf(x); | ||
t -= 1.0; | if (x - t >= 0.5) | ||
t += 1.0; | |||
return (-t); | return (-t); | ||
} | } | ||
} | } |