Title
Semantics of arithmetic comparisons
Status
cd1
Section
7.6.9 [expr.rel]
Submitter
Daveed Vandevoorde

Created on 2007-11-27.00:00:00 last changed 188 months ago

Messages

Date: 2008-06-15.00:00:00

[Voted into the WP at the June, 2008 meeting.]

Date: 2008-02-15.00:00:00

Proposed resolution (February, 2008):

  1. Append the following paragraph to the end of 7.6.9 [expr.rel]:

  2. If both operands (after conversions) are of arithmetic type, each of the operators shall yield true if the specified relation is true and false if it is false.
  3. Append the following paragraph to the end of 7.6.10 [expr.eq]:

  4. Each of the operators shall yield true if the specified relation is true and false if it is false.
Date: 2008-07-27.00:00:00

The actual semantics of arithmetic comparison — e.g., whether 1 < 2 yields true or false — appear not to be specified anywhere in the Standard. The C Standard has a general statement that

Each of the operators < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to) shall yield 1 if the specified relation is true and 0 if it is false.

There is no corresponding statement in the C++ Standard.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: dr -> cd1
2008-07-27 00:00:00adminsetmessages: + msg1742
2008-06-29 00:00:00adminsetstatus: ready -> dr
2008-03-17 00:00:00adminsetmessages: + msg1590
2008-03-17 00:00:00adminsetstatus: open -> ready
2007-11-27 00:00:00admincreate