Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

pow_ri.c

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

Powered by Plone

This site conforms to the following standards: