Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site turtlevax.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!turtlevax!ken
From: ken@turtlevax.UUCP (Ken Turkowski)
Newsgroups: net.lang.c
Subject: Re: re: how has C bitten you?
Message-ID: <860@turtlevax.UUCP>
Date: Mon, 12-Aug-85 15:08:43 EDT
Article-I.D.: turtleva.860
Posted: Mon Aug 12 15:08:43 1985
Date-Received: Thu, 15-Aug-85 01:33:24 EDT
References: <505@brl-tgr.ARPA>
Reply-To: ken@turtlevax.UUCP (Ken Turkowski)
Organization: CADLINC, Inc. @ Menlo Park, CA
Lines: 29

In a previous article Brian Jones writes:
>>So, printf can never get a float as an argument, it always gets a double.
>>Therefore, %lf or %F are meaningless to printf.

PLEASE, don't use %F, when you can use %lf, and similarly for %E, %G,
%X, etc.

The biggest mistake in the implementation of printf is a disregard to
the standard in outputting hexadecimal and e-type output.  In the rest
of the programming world, hexadecimal is output as (for example):

	10AD            rather than             10ad

and floating-point e-type output as:

	3.1415926E+00   rather than             3.141592654e+00

Some implementations of printf intrepret %E and %G to mean "use 'E'
rather than 'e'".  Similarly, %X means "use the character set
[0123456789ABCDEF] rather than [0123456789abcdef] to print hexadecimal
numbers."  If you want to print out a long using cap hex, you would
use the format specifier "%lX".

Does anyone know what the proposed ANSI standard says about this?
-- 

Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.ARPA