// MS-Bug # 999,995 (5 left for 1 million bugs :-) :

const double d = DBL_MIN;

double v00 = 0.0;
bool f00 = v00 > d;

double v01 = 0.1;
bool f01 = v01 > d;

gives wrongly 'false' for f00... :-)

Re: Bad FP error with MS C++ compiler by Alex

Alex
Sun Jul 20 09:46:58 CDT 2008

"Adem24" <adem24@adem24.org.invalid> wrote:
> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>
> const double d = DBL_MIN;
>
> double v00 = 0.0;
> bool f00 = v00 > d;
>
> double v01 = 0.1;
> bool f01 = v01 > d;
>
> gives wrongly 'false' for f00... :-)

The bug is in your code. DBL_MIN is a minimal positive value.

Alex



Re: Bad FP error with MS C++ compiler by Adem24

Adem24
Sun Jul 20 09:49:24 CDT 2008

"Adem24" wrote:
>
> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>
> const double d = DBL_MIN;
>
> double v00 = 0.0;
> bool f00 = v00 > d;
>
> double v01 = 0.1;
> bool f01 = v01 > d;
>
> gives wrongly 'false' for f00... :-)

Further analysis shows that it has nothing todo with the DBL_MIN
but the value ZERO !
Ie. the MS compiler treats the value 0 not correctly in FP ops.


Re: Bad FP error with MS C++ compiler by peter

peter
Sun Jul 20 09:55:28 CDT 2008

On 20 Jul., 16:10, "Adem24" <ade...@adem24.org.invalid> wrote:
> // MS-Bug =A0# 999,995 (5 left for 1 million bugs :-) :
Or Adem24 bug# 3562?
>
> =A0 =A0 =A0 =A0const double d =3D DBL_MIN;
d is bigger than 0: perhaps it would help to read the documentation?
>
> =A0 =A0 =A0 =A0double v00 =3D 0.0;
> =A0 =A0 =A0 =A0bool =A0 f00 =3D v00 > d;
>
> =A0 =A0 =A0 =A0double v01 =3D 0.1;
> =A0 =A0 =A0 =A0bool =A0 f01 =3D v01 > d;
>
> gives wrongly 'false' for f00... :-)

f00 should be true.

/Peter

Re: Bad FP error with MS C++ compiler by Victor

Victor
Sun Jul 20 10:45:18 CDT 2008

peter koch wrote:
> On 20 Jul., 16:10, "Adem24" <ade...@adem24.org.invalid> wrote:
>> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
> Or Adem24 bug# 3562?
>>
>> const double d = DBL_MIN;
> d is bigger than 0: perhaps it would help to read the documentation?
>>
>> double v00 = 0.0;
>> bool f00 = v00 > d;
>>
>> double v01 = 0.1;
>> bool f01 = v01 > d;
>>
>> gives wrongly 'false' for f00... :-)
>
> f00 should be true.

REALLY? Should it? What's DBL_MIN, by definition? Hint: it's
defined on the 5.2.4.2.2 of the C standard.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask



Re: Bad FP error with MS C++ compiler by Juha

Juha
Sun Jul 20 10:49:03 CDT 2008

Adem24 wrote:
> "Adem24" wrote:
>> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>>
>> const double d = DBL_MIN;
>>
>> double v00 = 0.0;
>> bool f00 = v00 > d;
>>
>> double v01 = 0.1;
>> bool f01 = v01 > d;
>>
>> gives wrongly 'false' for f00... :-)
>
> Further analysis shows that it has nothing todo with the DBL_MIN
> but the value ZERO !
> Ie. the MS compiler treats the value 0 not correctly in FP ops.

Given that DBL_MIN is a positive value (larger than 0), exactly how is
this a bug?

Re: Bad FP error with MS C++ compiler by Erik-wikstrom

Erik-wikstrom
Sun Jul 20 11:18:46 CDT 2008

On 2008-07-20 16:10, Adem24 wrote:
> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>
> const double d = DBL_MIN;
>
> double v00 = 0.0;
> bool f00 = v00 > d;
>
> double v01 = 0.1;
> bool f01 = v01 > d;
>
> gives wrongly 'false' for f00... :-)

Did you submit this "bug" to the gcc-team also, because I get the same
effect using gcc as with MSVC.

--
Erik Wikström

Re: Bad FP error with MS C++ compiler by Gennaro

Gennaro
Sun Jul 20 11:55:25 CDT 2008

Erik Wikström wrote:
> On 2008-07-20 16:10, Adem24 wrote:
>> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>>
>> const double d = DBL_MIN;
>>
>> double v00 = 0.0;
>> bool f00 = v00 > d;
>>
>> double v01 = 0.1;
>> bool f01 = v01 > d;
>>
>> gives wrongly 'false' for f00... :-)
>
> Did you submit this "bug" to the gcc-team also, because I get the same
> effect using gcc as with MSVC.

:-) Out of curiosity, is there really a bug count for VC++, somewhere?

--
Gennaro Prota | <https://sourceforge.net/projects/breeze/>
Do you need expertise in C++? I'm available.

Re: Bad FP error with MS C++ compiler by Tim

Tim
Sun Jul 20 23:46:48 CDT 2008

"Adem24" <adem24@adem24.org.invalid> wrote:

>"Adem24" wrote:
>>
>> // MS-Bug # 999,995 (5 left for 1 million bugs :-) :
>>
>> const double d = DBL_MIN;
>>
>> double v00 = 0.0;
>> bool f00 = v00 > d;
>>
>> double v01 = 0.1;
>> bool f01 = v01 > d;
>>
>> gives wrongly 'false' for f00... :-)
>
>Further analysis shows that it has nothing todo with the DBL_MIN
>but the value ZERO !
>Ie. the MS compiler treats the value 0 not correctly in FP ops.

I can't tell from this whether you are admitting that you are wrong, or are
moving off into other foolishness. "f00" SHOULD be false. Do you now
agree with that?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: Bad FP error with MS C++ compiler by Alessandro

Alessandro
Mon Jul 21 03:04:37 CDT 2008

"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:8fKdnQX_EMETwB7VnZ2dnUVZ_szinZ2d@comcast.com...
>>> double v00 = 0.0;
>>> bool f00 = v00 > d;
>>> gives wrongly 'false' for f00... :-)
>>
>> f00 should be true.
>
> REALLY? Should it? What's DBL_MIN, by definition? Hint: it's
> defined on the 5.2.4.2.2 of the C standard.

DBL_MIN (like FLT_MIN and LDBL_MIN) is "minimum normalized positive
floating-point number", defined as 1E-37 (that is a number bigger than 0)



Re: Bad FP error with MS C++ compiler by Victor

Victor
Mon Jul 21 07:51:27 CDT 2008

Gennaro Prota wrote:
> [..]
> :-) Out of curiosity, is there really a bug count for VC++, somewhere?
>

There must be. Since you can add to the collection (and check if your
addition is in the collection), there must be a way to obtain the size
of the collection, right? Now, I am not sure there is a publicly
available bug count. See https://connect.microsoft.com/VisualStudio/

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Re: Bad FP error with MS C++ compiler by joseph

joseph
Mon Jul 21 09:04:24 CDT 2008

On Jul 20, 10:49=A0am, "Adem24" <ade...@adem24.org.invalid> wrote:
> Further analysis shows that =A0it has nothing todo with the DBL_MIN
> but the value ZERO !
> Ie. the MS compiler treats the value 0 not correctly in FP ops.

Woah! Slow down. Millions (Billions? Trillions?) of lines of code
have been written using Microsoft compilers. Think about the
likelyhood that you are the first person to have tried using "0" in a
FP operation, and then consider the possibility that the problems lies
on your end, not the compilers.

--JC


Re: Bad FP error with MS C++ compiler by James

James
Tue Jul 22 02:43:29 CDT 2008

On Jul 21, 2:51 pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
> Gennaro Prota wrote:
> > [..]
> > :-) Out of curiosity, is there really a bug count for VC++, somewhere?

> There must be. Since you can add to the collection (and check
> if your addition is in the collection), there must be a way to
> obtain the size of the collection, right?

But what does it mean? Anyone who's worked in support at one
time or another knows that 90% of the complaints are user error
(like the one that started this thread). The fact that VC++ is
the most widely used compiler by beginners probably means that
it will get the most "bug reports": for some beginners (often
the most stupid), the problem is always the compiler, and not
their stupidity.

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34

Re: Bad FP error with MS C++ compiler by Victor

Victor
Tue Jul 22 07:28:19 CDT 2008

James Kanze wrote:
> On Jul 21, 2:51 pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
>> Gennaro Prota wrote:
>>> [..]
>>> :-) Out of curiosity, is there really a bug count for VC++, somewhere?
>
>> There must be. Since you can add to the collection (and check
>> if your addition is in the collection), there must be a way to
>> obtain the size of the collection, right?
>
> But what does it mean? Anyone who's worked in support at one
> time or another knows that 90% of the complaints are user error
> (like the one that started this thread). The fact that VC++ is
> the most widely used compiler by beginners probably means that
> it will get the most "bug reports": for some beginners (often
> the most stupid), the problem is always the compiler, and not
> their stupidity.

Any product, especially as complex as a C++ compiler, contains errors
and misbehaviours, most of which are unintentional. *If* the product
manufacturer is interested in improving the product or at least their
image, they will be collecting the information on what seems to be wrong
with their product. Such information is often put in the form of a list
(of so called "bugs"). The list is finite, hence has a size. Some
manufacturers even make such lists public, many don't. Even if the list
is not public, it tends to have a size. That's what it means.

The suggestions or complaints are always verified against the product
specification, against common sense, product development schedules, etc.
If the suggestion is due to user error, it most likely will not be put
on the list of suggestions (although if it's an indication of a missing
feature or a possible work flow improvement, it might, indirectly). So,
the list of bugs most likely does not contain "bug reports" created due
to somebody's stupidity.

When I say "you can add to the collection" I don't mean "you can send an
e-mail about your problem". I mean you can cause the collection to grow
if your report is about a real defect in the product or contains a
genuine improvement suggestion.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask