Logo Search packages:      
Sourcecode: gcc-2.95 version File versions

bug-40189.c

#include <stdio.h>
#include <math.h>


int
main() {

  double a[4]={0.006776,2.5,3.0,0.006776},w[4]={0.000030,3.7,3.0,0.000030},t,amin;
  int ir,i,nr=4;
  double tol=9.31322574615479e-10*3.0;

  for (i=0,ir=-1,amin=DBL_MAX;i<nr;i++) 
    if (a[i]>tol) {
      t=w[i]/a[i];
      if (t<amin || ir==-1) {
        amin=t;
        ir=i;
      }
    }
  
  printf("ir=%d\n",ir);

  for (i=0,ir=-1,amin=DBL_MAX;i<nr;i++) 
    if (a[i]>tol && ((t=w[i]/a[i])<amin || ir==-1)) {
        amin=t;
        ir=i;
      }
  
  printf("ir=%d\n",ir);

  exit(0);

}

Generated by  Doxygen 1.6.0   Back to index