By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

Defect Report : numeric_limits::is_modulo insufficently defined.

P: n/a
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 insufficent for the following reasons:

1) Doesn't define what that value recieved 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.

Suggest this text is ammeded to:

"A type is modulo if, 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) "

Nov 6 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Azumanga wrote:
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 insufficent for the following reasons:

1) Doesn't define what that value recieved 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.

Suggest this text is ammeded to:

"A type is modulo if, 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) "
You probably meant to post in comp.std.c++.

Cheers! --M

Nov 6 '06 #2

P: n/a
Azumanga <4z******@gmail.comwrote:
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 insufficent for the following reasons:

1) Doesn't define what that value recieved 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.

Suggest this text is ammeded to:

"A type is modulo if, 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) "
There is a discussion on this topic over on comp.std.c++:

http://groups.google.com/group/comp....bfd3c42666b5d/

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Nov 6 '06 #3

P: n/a

mlimber wrote:
Azumanga wrote:
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 insufficent for the following reasons:

1) Doesn't define what that value recieved 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.

Suggest this text is ammeded to:

"A type is modulo if, 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) "

You probably meant to post in comp.std.c++.
Yes I did. Woops. Sorry!

Chris

Nov 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.