xref: /csrg-svn/usr.bin/pascal/libpc/ROUND.c (revision 40865)
1*40865Sbostic /*-
2*40865Sbostic  * Copyright (c) 1979 The Regents of the University of California.
3*40865Sbostic  * All rights reserved.
4*40865Sbostic  *
5*40865Sbostic  * %sccs.include.redist.c%
6*40865Sbostic  */
71697Smckusick 
8*40865Sbostic #ifndef lint
9*40865Sbostic static char sccsid[] = "@(#)ROUND.c	1.4 (Berkeley) 04/09/90";
10*40865Sbostic #endif /* not lint */
111697Smckusick 
123028Smckusic long
131697Smckusick ROUND(value)
141697Smckusick 
151697Smckusick 	double	value;
161697Smckusick {
172960Smckusic 	if (value >= 0.0)
182960Smckusic 		return (long)(value + 0.5);
192960Smckusic 	return (long)(value - 0.5);
201697Smckusick }
21