[Issue 1756] New: comparing a constant to artihmetic expression with floating point types fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 31 04:21:47 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1756
Summary: comparing a constant to artihmetic expression with
floating point types fails
Product: D
Version: 2.008
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: sven.stoenner at googlemail.com
the direct comparison of a constant to an arithmetic expression does not work
correctly when using variables:
// float
float a = 0.6f, 0.8f;
float c = a / b;
assert(c == 0.6f / 0.8f); // ok
assert(c == a / b); // fails
assert(0.75f == 0.6f / 0.8f); // ok
assert(0.75f == a / b); // fails
// double
double a = 0.6, b = 0.8;
double c = a / b;
assert(c == 0.6 / 0.8); // fails
assert(c == a / b); // fails
assert(0.75 == 0.6 / 0.8); // ok
assert(0.75 == a / b); // fails
--
More information about the Digitalmars-d-bugs
mailing list