delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/02/12:38:50

Message-ID: <16@rcoca.pcnet.ro>
Reply-To: rcoca AT pcnet DOT pcnet DOT ro (Razvan)
To: djgpp AT delorie DOT com
Date: Sat, 02 Aug 1997 11:15:19
Subject: Re:scanf?
From: rcoca AT pcnet DOT pcnet DOT ro (Razvan)

>I don't dare describe it as a bug, but IMHO it's at least a
>misfeature. The problem is that scanf("%e",...) (or %f, or %g)
>reads a float. But if you use upper case, it reads a double instead
>(or a long double if you use an `l' already). As a workaround, to
>read a double, use the standard %le format. 

This is my fault, I wasn`t too clear.
The sequence  scanf("%E",..);scanf("%e",..)produces the expected
result, while scanf("%e",..);scanf("%E",..) doesn`t.  

>Can somebody with a copy of the ANSI standard enlighten us as to
>whether this is supposed to happen? There is already a bug with
>formats like %LG, for which I posted a patch some time ago.

At 09:15  7/31/1997, you wrote:

>---------------
>#include <stdio.h>
>#include <conio.h>
>double d;
>
>int main(int argc,char*argv[])
> {clrscr();
> /* this doesn`t work*/
> scanf("%e",&d);
> printf("\n%E",d);
>
>/* this works */ 
> scanf("%E",&d);
> printf("\n%E",d);
>
> getch();
> return 0;
> }
> --------



- Raw text -


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