xref: /csrg-svn/usr.bin/f77/libF77/r_nint.c (revision 22964)
110533Sdlw /*
2*22964Skre  * Copyright (c) 1980 Regents of the University of California.
3*22964Skre  * All rights reserved.  The Berkeley software License Agreement
4*22964Skre  * specifies the terms and conditions for redistribution.
5*22964Skre  *
6*22964Skre  *	@(#)r_nint.c	5.1	06/07/85
710533Sdlw  */
810533Sdlw 
910533Sdlw double r_nint(x)
1010533Sdlw float *x;
1110533Sdlw {
1210533Sdlw double floor();
1310533Sdlw 
1410533Sdlw return( (*x)>=0 ?
1510533Sdlw 	floor(*x + .5) : -floor(.5 - *x) );
1610533Sdlw }
17