www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/05/06:06:11

Date: Thu, 5 Sep 1996 02:52:28 -0700 (PDT)
From: Samuel Vincent <svincent AT cs DOT sonoma DOT edu>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: "x DOT pons AT cc DOT uab DOT es" <ILGES AT cc DOT uab DOT es>, djgpp AT delorie DOT com
Subject: Re: printf format string question
In-Reply-To: <Pine.SUN.3.91.960905111451.363A-100000@is>
Message-ID: <Pine.GSO.3.94.960905025133.12616A-100000@zippy>
MIME-Version: 1.0

On Thu, 5 Sep 1996, Eli Zaretskii wrote:

> On Wed, 4 Sep 1996, x DOT pons AT cc DOT uab DOT es wrote:
> 
> > How can specify a width fixed to 3 for the exponent of double variables
> > in printf format strings? That is to say, I want an output like
> >   3.2345E+034
> >   3.2345E+134
> 
> I don't think this is possible, at least not in ANSI C.  The ANSI 
> standard says the exponent will always have at least 2 digits, but 
> promises nothing else, and no flags are provided to have any control 
> whatsoever on the exponent field.

Oh come now.. it's always possible to do anything.. :)

Just grab the printf function from the libc source and modify it to your
heart's content. ;)

-Sam


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019