Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / f77 / libF77 / pow_di.c
CommitLineData
69fcff2c 1/*
989888af
RE
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 * @(#)pow_di.c 5.1 %G%
69fcff2c
DW
7 */
8
9double pow_di(ap, bp)
10double *ap;
11long int *bp;
12{
13double pow, x;
14long int n;
15
16pow = 1;
17x = *ap;
18n = *bp;
19
20if(n != 0)
21 {
22 if(n < 0)
23 {
24 if(x == 0)
25 {
26 return(pow);
27 }
28 n = -n;
29 x = 1/x;
30 }
31 for( ; ; )
32 {
33 if(n & 01)
34 pow *= x;
35 if(n >>= 1)
36 x *= x;
37 else
38 break;
39 }
40 }
41return(pow);
42}