Bug 1881 – feqrel nonsensical for two identical float arguments
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-02-29T02:39:00Z
Last change time
2015-06-09T01:14:35Z
Assigned to
clugdbug
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2008-02-29T02:39:33Z
Given
float a;
assert(feqrel(a,a) == real.mant_dig);
which is nonsensical; the return value should never exceed the precision of the arguments. Should be float.mant_dig.
The solution is to turn feqrel into a template, and require both arguments to be the same type.