xref: /csrg-svn/usr.bin/f77/libF77/d_nint.c (revision 22865)
110464Sdlw /*
2*22865Skre  * Copyright (c) 1980 Regents of the University of California.
3*22865Skre  * All rights reserved.  The Berkeley software License Agreement
4*22865Skre  * specifies the terms and conditions for redistribution.
5*22865Skre  *
6*22865Skre  *	@(#)d_nint.c	5.1	06/07/85
710464Sdlw  */
810464Sdlw 
910464Sdlw double d_nint(x)
1010464Sdlw double *x;
1110464Sdlw {
1210464Sdlw double floor();
1310464Sdlw 
1410464Sdlw return( (*x)>=0 ?
1510464Sdlw 	floor(*x + .5) : -floor(.5 - *x) );
1610464Sdlw }
17