Commit | Line | Data |
---|---|---|
f990d254 | 1 | /* |
e92e731c RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
95f51977 | 6 | * @(#)r_nint.c 5.3 7/9/85 |
f990d254 DW |
7 | */ |
8 | ||
e2fcf16d JB |
9 | float flt_retval; |
10 | ||
46452188 | 11 | float r_nint(x) |
f990d254 DW |
12 | float *x; |
13 | { | |
14 | double floor(); | |
15 | ||
e2fcf16d JB |
16 | flt_retval = (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x); |
17 | return(flt_retval); | |
f990d254 | 18 | } |