Defect Report : numeric_limits::is_modulo insufficently defined.

A

Azumanga

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) "
 
M

Marcus Kwok

Azumanga said:
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.std.c++/browse_frm/thread/eddbfd3c42666b5d/
 
M

mlimber

Azumanga said:
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
 
A

Azumanga

mlimber said:
Azumanga said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top