On 2011-08-30 13:25-0700 Alan W. Irwin wrote:
On 2011-08-30 08:33-0700 Dan Kegel wrote:
Today I discovered .. that the scanf family of functions was
introducing float (32-bit floating-point) noise into double (64-bit
floating-point) results.
I see it here, too:
$ sudo apt-get install mingw3
On 2011-08-30 08:33-0700 Dan Kegel wrote:
Today I discovered .. that the scanf family of functions was
introducing float (32-bit floating-point) noise into double (64-bit
floating-point) results.
I see it here, too:
$ sudo apt-get install mingw32
$ i586-mingw32msvc-gcc test_fscanf.c
$ echo "1
Le 30/08/2011 20:38, Peter Rosin a écrit :
Den 2011-08-30 20:18 skrev David Laight:
On Mon, Aug 29, 2011 at 06:43:41PM -0700, Alan W. Irwin wrote:
double x;
while(fscanf(stdin, " %le ",&x) == 1)
You are using the wrong format, %le is for 'long double', this will
probably overwrite too mu
Den 2011-08-30 20:18 skrev David Laight:
> On Mon, Aug 29, 2011 at 06:43:41PM -0700, Alan W. Irwin wrote:
>> double x;
>> while(fscanf(stdin, " %le ", &x) == 1)
>
> You are using the wrong format, %le is for 'long double', this will
> probably overwrite too much data.
Nope, you are mistaken a
On Mon, Aug 29, 2011 at 06:43:41PM -0700, Alan W. Irwin wrote:
> double x;
> while(fscanf(stdin, " %le ", &x) == 1)
You are using the wrong format, %le is for 'long double', this will
probably overwrite too much data.
David
--
David Laight: da...@l8s.co.uk
> Today I discovered .. that the scanf family of functions was
> introducing float (32-bit floating-point) noise into double (64-bit
> floating-point) results.
I see it here, too:
$ sudo apt-get install mingw32
$ i586-mingw32msvc-gcc test_fscanf.c
$ echo "1.1e+01
1.1e+00
1.1e-01
1.1e-02
1.1e-03
1
Today I discovered while debugging a fairly complex application that I
built under MinGW/MSYS/wine that the scanf family of functions was
introducing float (32-bit floating-point) noise into double (64-bit
floating-point) results.
I implemented a simple test code to make it extremely easy to
repl