Assinging values to type float

Christopher R Volpe volpe at underdog.crd.ge.com
Tue Sep 4 09:05:24 AEST 1990


In article <1258 at kubix.kub.nl>, mad-2 at kub.nl (C. Wekx) writes:
|>I don't understand what the fuss is all about as a well-known C-author,
|>H. Schildt writes in his book 'C: The complete reference' on page 40:
|>float f=123.23, without an explicit type cast....

This raises a question I've been wondering about for a while: When
we say that a float (or char) gets converted to a double (or int) in
an expression, what exactly constitutes an expression? Is a single
value on the RHS of an assignment operator an "expression" for
conversion purposes? Or is at least one operator required? If
I do a "f1=f2", does it first convert f2 to double and then back 
to float in order to do the assignment? How about "c1=c2" for chars?       
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list