[Issue 10448] New: min and max are not NaN aware
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jun 22 12:48:41 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10448
Summary: min and max are not NaN aware
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2013-06-22 12:48:40 PDT ---
(and so are probably minCount, minPos, or mostly everything else that is
related to opCmp).
>From the discussion https://github.com/D-Programming-Language/phobos/pull/1360
:
min(0, float.nan); //Yields 0
max(0, float.nan); //Yields 0
min(float.nan, 0); //Yields float.nan
max(float.nan, 0); //Yields float.nan
Not sure what the correct solution is: Throwing an exception on NaN might be
too expensive? How about an assert, combined with an explicit: "Passing nan is
an ERROR", and let the user decide if/ifnot to pay for the check?
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list