This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[cw@gamma-rs.ch: error in scanf reading %le format and 00 exponent]
- From: Christopher Faylor <cgf-newlib at cygwin dot com>
- To: newlib at sourceware dot org
- Date: Mon, 7 Mar 2005 11:14:54 -0500
- Subject: [cw@gamma-rs.ch: error in scanf reading %le format and 00 exponent]
- Reply-to: newlib at sourceware dot org
----- Forwarded message from "Charles L. Werner" -----
From: "Charles L. Werner"
To: cygwin
Subject: error in scanf reading %le format and 00 exponent
Date: Mon, 07 Mar 2005 17:08:45 +0100
Organization: Gamma Remote Sensing AG
Hi,
I seem to have detected a serious error (for me of course...)
in the current cygwin 1.5.13 library. The minus sign of input values with
a e+00 exponent, for example
-1.1e+00 fail to read the minus sign. Here is a short program rdf.c that
demonstrates the
problem. Compiled with
gcc rdf.c -o rdf.exe
#include <stdio.h>
main()
{
double a;
while(1){
printf("input: ");
scanf("%le",&a);
printf("a: %le\n",a);
}
}
Here are some examples that show the bug:
$ rdf
input: -.11e+00
a: 1.100000e-01 !akkk
input: -1.1e+00
a: 1.100000e+00 !akkk
input: -1.1e00
a: 1.100000e+00 !akkk
input: -11e-01
a: -1.100000e+00 !akkk
input: -.11E+01 !ok
a: -1.100000e+00
input: -11e-01 !ok
a: -1.100000e+00
So the problem seems to be related to the case where the exponent is 00.
What is to be done?
Thanks
Charles
--
Dr. Charles L. Werner
Gamma Remote Sensing AG
Worbstr. 225
CH-3073 G?mligen, Switzerland
Tel: +41 31 951 70 05
FAX: +41 31 951 70 08
http://www.gamma-rs.ch
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
----- End forwarded message -----