Bug 19488 – std.typecons.Nullable(T, T nullValue) doesn't handle NaN for built-in complex and imaginary

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2018-12-15T03:24:31Z
Last change time
2018-12-15T08:01:39Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-12-15T03:24:31Z
std.typecons.Nullable(T, T nullValue) doesn't handle NaN for built-in complex and imaginary types. Example: --- void main() { import std.typecons; Nullable!(cfloat, cfloat.nan) a = cfloat.nan; assert(a.isNull); // fails Nullable!(ifloat, ifloat.nan) b = ifloat.nan; assert(b.isNull); // fails if above is commented out } ---
Comment #1 by n8sh.secondary — 2018-12-15T03:27:33Z
Comment #2 by n8sh.secondary — 2018-12-15T08:01:39Z
Clearly a duplicate of 19226. Not sure why I opened this. *** This issue has been marked as a duplicate of issue 19226 ***