On Sunday, 30 September 2012 at 01:29:24 UTC, Ivan Agafonov wrote:
// Tell me about this sutation, may be it is a bug?
[SNIP]
// all of this fails!!!
assert (a.length == a.length); // This is really shocking
assert (a.length == a3.length);
[SNIP]
This is just a fact of life regarding how floating point types
work. Here is a well documented explanation. It pertains to C++,
but applies.
http://www.parashift.com/c++-faq/floating-point-arith2.html
As a rule of thumb, NEVER use opEqual with floating point types
aniways. You need to use some sort of comparison with leway for
error, such as std.math.approxEqual.