From: Oscar F. <of...@wa...> - 2002-10-17 19:39:01
|
Joaquin Ferruz Melero <fe...@ca...> writes: [snip] > > > Is it correct that compiled code behaves differently when it is > > > optimized? > > > > Yes, absolutely. > > > > Indeed? Without my doing anything wrong? You have shaken my > deepest convictions... :-( Well, let me clarify: It is not enough with translating a formula or algorithm to the "equivalent" source code for obtaining correct results. Those formulas and algorithms assumes true real numbers, but computers doesn't work with true real numbers. This complicates everything, and it's just the beginning. Certainly, it is possible to write code on a way that is independent of the compiler used, but it is far from obvious, at least for non-trivial calculations. Pay close attention to Ranjit's advice. -- Oscar |