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  

cdf_56.c

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 double exparg(int *l)
00003 /*
00004 --------------------------------------------------------------------
00005      IF L = 0 THEN  EXPARG(L) = THE LARGEST POSITIVE W FOR WHICH
00006      EXP(W) CAN BE COMPUTED.
00007  
00008      IF L IS NONZERO THEN  EXPARG(L) = THE LARGEST NEGATIVE W FOR
00009      WHICH THE COMPUTED VALUE OF EXP(W) IS NONZERO.
00010  
00011      NOTE... ONLY AN APPROXIMATE VALUE FOR EXPARG(L) IS NEEDED.
00012 --------------------------------------------------------------------
00013 */
00014 {
00015 static int K1 = 4;
00016 static int K2 = 9;
00017 static int K3 = 10;
00018 static double exparg,lnb;
00019 static int b,m;
00020 /*
00021      ..
00022      .. Executable Statements ..
00023 */
00024     b = ipmpar(&K1);
00025     if(b != 2) goto S10;
00026     lnb = .69314718055995e0;
00027     goto S40;
00028 S10:
00029     if(b != 8) goto S20;
00030     lnb = 2.0794415416798e0;
00031     goto S40;
00032 S20:
00033     if(b != 16) goto S30;
00034     lnb = 2.7725887222398e0;
00035     goto S40;
00036 S30:
00037     lnb = log((double)b);
00038 S40:
00039     if(*l == 0) goto S50;
00040     m = ipmpar(&K2)-1;
00041     exparg = 0.99999e0*((double)m*lnb);
00042     return exparg;
00043 S50:
00044     m = ipmpar(&K3);
00045     exparg = 0.99999e0*((double)m*lnb);
00046     return exparg;
00047 } /* END */
 

Powered by Plone

This site conforms to the following standards: