dwb@sticks.apple.com (David Berry) (05/03/90)
In article <12749@smoke.BRL.MIL> cjohnson@smoke.BRL.MIL (Christopher T. Johnson) writes: >On a related note the verion of gcc(1.37) available from apple.com >generates bad code. I have two test cases that fail. In both cases >the code was checking to see if a double was near zero. > > {double junk = 0.0; > if (junk <0.0001 && junk > -0.0001) { > fprintf(stderr,"junk almost equal zero\n"); > } else { > fprintf(stderr,"junk != zero ??????\n"); > } > } Actually, this is a bug in the A/UX assembler. Gcc is generating valid code that the assembler generates byte code for. To get around it, always use the -O option (optimize) when dealing with floating point constants. David W. Berry A/UX Toolbox Engineer dwb@apple.com