manual page distributed with 4.1BSD
[unix-history] / usr / src / old / libm / liboldnm / acos.c
CommitLineData
8daa8d7c
DF
1/*
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 */
6
7#ifndef lint
8static char sccsid[] = "@(#)acos.c 5.1 (Berkeley) %G%";
9#endif not lint
10
63e697a2
DF
11/*
12acos(arg) return the arccos,
13 respectively of their arguments.
14
15 Arctan is called after appropriate range reduction.
16*/
17
18#include <errno.h>
19int errno;
20double atan();
21double asin();
22static double pio2 = 1.570796326794896619;
23
24double
25acos(arg) double arg; {
26
27 asm(" bispsw $0xe0");
28 if(arg > 1.|| arg < -1.){
29 errno = EDOM;
30 return(0.);
31 }
32
33 return(pio2 - asin(arg));
34}