Floating point minimum values are positive?
bearophile
bearophileHUGS at lycos.com
Mon Jul 22 15:19:27 PDT 2013
Joseph Rushton Wakeling:
> It so happens that for the code in question I did, and had got
> that warning, and made the switch. I just hadn't realized that
> in either case the value would be positive! I just noticed
> because of a case where I was initializing a value to
> real.min_normal and then taking the max of this variable and
> zero, and I'd anticipated 0 would be the max.
I see, and indeed a better warning message should talk about both
min_normal and about -max, to help both people used with C++
double min and newer programmers that don't care of C++
history... Andrej Mitrovic could improve that textual message.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list