[PLUG] C compiler question

Phil Tomson ptkwt at aracnet.com
Mon Feb 3 21:59:02 UTC 2003


It's hard to say without seeing the code.

Perhaps they were using a much older version of gcc and the newer one is
doing something better (or maybe worse, again, hard to say without seeing
what you're trying to do...)

Phil

On Mon, 3 Feb 2003, stuart mathews wrote:

> While learning C, I ran this exercise designed to demonstrate floating point
> rounding errors. You run a program that adds two float numbers. The book said
> the output would be one of the following, depending on your system;
>
> 1. gcc / Linux  =    0.00000
> 2. Turbo C 1.5  =    -13584010575872.000000
> 3. CodeWarrior 5.0, MSVC++ 6.0  =  4008175468544.000000
>
> On my system, (Compaq PII, Redhat 8.0, gcc version 3.2), the out put was exactly
> that for the "CodeWarrior" listed above.  Questions is, why that output instead
> of the gcc / Linux output?
>
> -------------------
> http://www.pcez.com
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>





More information about the PLUG mailing list