how has C bitten you?

Michael Barker mbarker at BBNZ.ARPA
Fri Aug 9 00:06:39 AEST 1985


...omitted

>So, printf can never get a float as an argument, it always gets a double.
>Therefore, %lf or %F are meaningless to printf.
>
>Brian Jones  aka  {ihnp4,}!drutx!qwerty  @  AT&T-IS

Brian (et al) - the reasoning is correct, but printf could easily be changed to
accept %lf or %F (or any useful convention) as formatting directions for a
value with the knowledge that the value will *actually* be a double.  Let's try
to avoid letting the implementation details run rough-shod over the
abstraction.

In this case, the original poster indicated that the mnemonics are incomplete
(you can't match up the type of variable and the formatting string in all
cases).  I think this is a very valid point.  The fact that the implementation
of printf will receive both types of variables as double shouldn't stop us from
providing a complete set of mnemonics.

	"The sleep of reason produces monsters"
	mike

ARPA: mbarker at bbnz.ARPA
UUCP: harvard!bbnccv!mbarker



More information about the Comp.lang.c mailing list