xref: /original-bsd/usr.bin/pascal/libpc/COS.c (revision ab0b9960)
1*ab0b9960Sbostic /*-
2*ab0b9960Sbostic  * Copyright (c) 1982 The Regents of the University of California.
3*ab0b9960Sbostic  * All rights reserved.
4*ab0b9960Sbostic  *
5*ab0b9960Sbostic  * %sccs.include.redist.c%
6*ab0b9960Sbostic  */
7a50a5cdeSmckusick 
8*ab0b9960Sbostic #ifndef lint
9*ab0b9960Sbostic static char sccsid[] = "@(#)COS.c	1.3 (Berkeley) 04/09/90";
10*ab0b9960Sbostic #endif /* not lint */
11a50a5cdeSmckusick 
12a50a5cdeSmckusick #include <math.h>
13a50a5cdeSmckusick extern int errno;
14a50a5cdeSmckusick 
15a50a5cdeSmckusick double
16a50a5cdeSmckusick COS(value)
17a50a5cdeSmckusick 	double	value;
18a50a5cdeSmckusick {
19a50a5cdeSmckusick 	double result;
20a50a5cdeSmckusick 
21a50a5cdeSmckusick 	errno = 0;
22a50a5cdeSmckusick 	result = cos(value);
23a50a5cdeSmckusick 	if (errno != 0) {
24a50a5cdeSmckusick 		ERROR("Cannot compute cos(%e)\n", value);
25a50a5cdeSmckusick 	}
26a50a5cdeSmckusick 	return result;
27a50a5cdeSmckusick }
28