C++ Logo

std-discussion

Advanced search

Re: Values of objects

From: Hyman Rosen <hyrosen_at_[hidden]>
Date: Wed, 28 Aug 2019 14:09:14 -0400
On Wed, Aug 28, 2019 at 1:14 PM language.lawyer--- via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> The same sequence of bits in value representation can mean different
> values.
>

What do you mean by different? The same sequence of bits in value
representation (should) mean that the two objects have the "same" value,
by definition. The values returned by operator== and related functions
can be whatever those functions find useful, and we should refer to such
values as "equal" and "not equal."

Floating-point gives us such behavior - two values having the same value
representation of a NaN cause operator== to report false. Two different
value representations, +0 and -0, cause operator== to report true.

Received on 2019-08-28 13:11:29