Issue612

Title 612. numeric_limits::is_modulo insufficiently defined
Status cd1 Section [numeric.limits.members]
Submitter Chris Jefferson

Created on 2006-11-10.00:00:00 by admin, last changed by admin.

Messages
msg2880 (view) Date: 2010-10-29.21:05:13

Proposed resolution:

Suggest [numeric.limits.members], paragraph 57 is amended to:

A type is modulo if, it is possible to add two positive numbers and have a result that wraps around to a third number that is less. given any operation involving +,- or * on values of that type whose value would fall outside the range [min(), max()], then the value returned differs from the true value by an integer multiple of (max() - min() + 1).

msg2879 (view) Date: 2010-10-29.21:05:13

[ Bellevue: accept resolution, move to ready status. Does this mandate that is_modulo be true on platforms for which int happens to b modulo? A: the standard already seems to require that. ]

msg2878 (view) Date: 2010-10-29.21:05:13

[ Batavia: Related to N2144. Pete: is there an ISO definition of modulo? Underflow on signed behavior is undefined. ]

msg2877 (view) Date: 2006-11-10.00:00:00

18.2.1.2 55 states that "A type is modulo if it is possible to add two positive numbers together and have a result that wraps around to a third number that is less". This seems insufficient for the following reasons:

  1. Doesn't define what that value received is.
  2. Doesn't state the result is repeatable
  3. Doesn't require that doing addition, subtraction and other operations on all values is defined behaviour.
History
Date User Action Args
2010-10-29 21:05:13adminsetmessages: + msg2880
2010-10-29 21:05:13adminsetmessages: + msg2879
2010-10-29 21:05:13adminsetmessages: + msg2878
2006-11-10 00:00:00admincreate