source: trunk/src/gcc/libf2c/libF77/pow_ri.c@ 645

Last change on this file since 645 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 369 bytes
Line 
1#include "f2c.h"
2
3#ifdef KR_headers
4double pow_ri(ap, bp) real *ap; integer *bp;
5#else
6double pow_ri(real *ap, integer *bp)
7#endif
8{
9double pow, x;
10integer n;
11unsigned long u;
12
13pow = 1;
14x = *ap;
15n = *bp;
16
17if(n != 0)
18 {
19 if(n < 0)
20 {
21 n = -n;
22 x = 1/x;
23 }
24 for(u = n; ; )
25 {
26 if(u & 01)
27 pow *= x;
28 if(u >>= 1)
29 x *= x;
30 else
31 break;
32 }
33 }
34return(pow);
35}
Note: See TracBrowser for help on using the repository browser.