Float-to-double promotion in ANSI C.
Barton E. Schaefer
schaefer at ogicse.ogi.edu
Wed Sep 5 07:28:39 AEST 1990
In article <RICHARD.90Sep3115406 at orange.iesd.auc.dk> richard at iesd.auc.dk (Richard Flamsholt S0rensen) writes:
} In article <11842 at ogicse.ogi.edu> schaefer at ogicse.ogi.edu (Barton E. Schaefer) writes:
}
} >ANSI has nothing to do with it. The only reason that floats are widened
} >to double in a function call is because they are widened to double in
} >all expression contexts.
} ^^^^^^^^^^^^^^^^^^^^^^^
}
} Nope. ANSI states ....
I was referring to K&R1 C, not ANSI C. (That's why I said "ANSI has nothing
to do with it", though I probably should have been more clear.)
Since we're on the topic, what does the Rationale say is the reason for
promotions in the case of K&R1-style declarations? Is it simple preservation
of the old semantics, or is there more to it? Does it give different reasons
for widening in the case of variadic functions?
--
Bart Schaefer schaefer at cse.ogi.edu
More information about the Comp.lang.c
mailing list