[Issue 13489] Boolean semantics of floating point types should use "<> 0"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 26 08:18:58 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13489

--- Comment #9 from Leandro Lucarella <leandro.lucarella at sociomantic.com> ---
(In reply to David Eckardt from comment #8)
> My point is: NaN was intentionally chosen as the initial floating point
> value to detect the common bug of forgetting to initialize a variable
> (http://dlang.org/faq.html#nan). The standard way to detect bugs is a plain
> assert(). So assert() should fail with NaN.

Yeah, this is the key, NaN should behave the same as null, it should explode as
soon as it's used.

> (PS. Amounts like 80,833,756,980 Vietnamese Đồng do happen so limiting them
> is far from trivial...)

Yeah, you should have to check the currency and maintain a table of conversion
rates. Not a very promising approach ;-)

--


More information about the Digitalmars-d-bugs mailing list