Comparing arrays of floats?
anonymous via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Oct 9 15:29:16 PDT 2015
On Saturday 10 October 2015 00:14, Straivers wrote:
> Is it a bit-by-bit comparison,
no
> is the std.math.approxEqual function get called for
> each element,
no
> or is it byte-by-byte across the entire array?
no
After comparing the lengths, the elements are checked for equality one by
one, using the usual `==` operator.
`==` is different from bitwise comparison. For example, -0f and +0f are `==`
equal but have different bits, and NaNs are equal no nothing, not even
themselves.
More information about the Digitalmars-d-learn
mailing list