pow_ri.c
Go to the documentation of this file.
00001 #include "f2c.h"
00002 #ifdef __cplusplus
00003 extern "C" {
00004 #endif
00005 
00006 #ifdef KR_headers
00007 double pow_ri(ap, bp) real *ap; integer *bp;
00008 #else
00009 double pow_ri(real *ap, integer *bp)
00010 #endif
00011 {
00012 double pow, x;
00013 integer n;
00014 unsigned long u;
00015 
00016 pow = 1;
00017 x = *ap;
00018 n = *bp;
00019 
00020 if(n != 0)
00021         {
00022         if(n < 0)
00023                 {
00024                 n = -n;
00025                 x = 1/x;
00026                 }
00027         for(u = n; ; )
00028                 {
00029                 if(u & 01)
00030                         pow *= x;
00031                 if(u >>= 1)
00032                         x *= x;
00033                 else
00034                         break;
00035                 }
00036         }
00037 return(pow);
00038 }
00039 #ifdef __cplusplus
00040 }
00041 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:56