Code Search for Developers
 
 
  

bug7.c from CQual at Krugle


Show bug7.c syntax highlighted


float pfKnuthEx28(unsigned int p, precision d)
{
   register float res;
   precision k = ((precision) 0) ;

   (void) (  d  )  ;
   if (p == 2) {
      if ((!podd( d )) ) {
	 (*(  &k  ) =     phalf(d)  )  ;
	 if ((!podd( k )) ) {
	    res = 2.0/3.0 + pfKnuthEx28(2,k)/2.0;     
	 } else {			       
	    res = 1.0/3.0;            
	 }
      } else {				 
	 (*(  &k  ) =     phalf(d)  )  ;
	 if (podd(k)) {
	    res = 1.0/3.0;		 
	 } else {
	    if (podd(phalf(k))) {
	       res = 2.0/3.0;		 
	    } else {
	       res = 4.0/3.0; 		 
	    }
	 }
      }
   } else {		 
      (*(  &k  ) =     utop(p)  )  ;
      if (pcmp(( ppowmod(d, phalf(psub(k, pone)), k) ), (  pone )) == 0)  {
	 res = (float) (p+p) / (((float) p)*p-1.0);   
      } else {
	 res = 0.0;
      }
   }

   (( k ) = 0 ) ;
   (( d ) = 0 ) ;
   if (debug > 1) {
      fprintf((&__iob[1]) , "f(%u,", p);
      fprintf((&__iob[1]) , "d) = %9.7f\n", res);
   }
   return res;
}




See more files for this project here

CQual

CQual - A tool for adding type qualifiers to C

Project homepage: http://sourceforge.net/projects/cqual
Programming language(s): C,Java,Shell Script
License: other

  ok/
  aa.c
  accept
  act.enviro.c
  array.c
  array1.c
  array2.c
  array3.c
  array4.c
  assign1.c
  attr1.c
  attr10.c
  attr10a.c
  attr11.c
  attr11a.c
  attr12.c
  attr12a.c
  attr12b.c
  attr12c.c
  attr13.c
  attr14.c
  attr2.c
  attr3.c
  attr4.c
  attr5.c
  attr6.c
  attr7.c
  attr8.c
  attr9.c
  blockexpr.c
  bug1.c
  bug10.c
  bug11.c
  bug12.c
  bug13.c
  bug14.c
  bug2.c
  bug3.c
  bug4.c
  bug4a.c
  bug5.c
  bug6.c
  bug7.c
  bug8.c
  bug9.c
  bugcast.c
  call1.c
  cast1.c
  cast2.c
  cast3.c
  cast4.c
  cast5.c
  cast6.c
  cast7.c
  char1.c
  char2.c
  clean
  compare
  compile.cpp
  complex1.c
  complex2.c
  complex3.c
  complex4.c
  complex4a.c
  cond1.c
  cond2.c
  cond3.c
  const1.c
  crash1.c
  cst.c
  cst2.c
  cst3.c
  cst4.c
  cst4a.c
  cst5.c
  cst6.c
  cst7.c
  divide0.c
  double1.c
  enum.cpp
  enum1.c
  enum2.c
  enum3.c
  expr1.c
  expr2.c
  extern1.c
  extern10.c
  extern11.c
  extern12.c
  extern13.c
  extern13b.c
  extern14.c
  extern15.c
  extern16.c
  extern17.c
  extern2.c
  extern3.c
  extern4.c
  extern5.c
  extern6.c
  extern7.c
  extern8.c
  extern9.c