On Sun, 14 Jun 1998, Bryan Scaringe wrote:

>NO!  Bad Karl!! Bad!
>
>Floats and doubles are defined using the decimal place.

This only metter in calculus.

>1.0
>
>however, C/C++ will assume floating point literals (such as 1.0)
>to be of type double, unless followed by an 'f' (1.0f).
>
>If you leave out the f, it is no real problem.  The 1.0 will be
>cast to type 'float' before assignment.

What' s the difference?

You could write also:

void main(void)
{
        float r = '0';
        printf("%f\n", r);
}

And '0' will be casted to float and it will print 48.000... as expected.

Andrea[s] Arcangeli

Reply via email to