From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 Description of problem: as in summary -> small example test: ---- #include <stdio.h> main(){ int i; for(i=0;i<10;i++) printf( "exp(%f)=%e ?\n", 1.0*i, exp( 1.0*i ) ); } ---- compiled with command 'gcc -O2 -lm -otest test.c' produces for example such results... ---- exp(0.000000)=2.057234e+10 ? exp(1.000000)=2.057234e+10 ? exp(2.000000)=2.057234e+10 ? exp(3.000000)=2.057234e+10 ? exp(4.000000)=2.057234e+10 ? exp(5.000000)=2.057234e+10 ? exp(6.000000)=2.057234e+10 ? exp(7.000000)=2.057234e+10 ? exp(8.000000)=2.057234e+10 ? exp(9.000000)=2.057234e+10 ? ---- Version-Release number of selected component (if applicable): glibc-2.3.2-27.9.7 How reproducible: Always Steps to Reproduce: as in description Actual Results: as in description Expected Results: it is the lates glibc patch for RH9 I think new one is required that will have at least math revised... Additional info:
This is a bug in the example. Functions without prototypes are assumed to return int. exp returns double, not int, so this really cannot work correctly, especially on architectures which return floating point values in different registers than integral ones. If you add #include <math.h> to the example, it will work just fine.