473,414 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Defect Report : numeric_limits::is_modulo insufficently defined.

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
3 1234
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dave | last post by:
Hello all, Is is allowable for me to specialize numeric_limits<> for my own numeric type? Does this violate any sort of rule against mucking with std? Thanks, Dave
5
by: lovecreatesbeauty | last post by:
Do #ifdef or #ifndef have some defects? I ever heard that some people use #if defined() or #if !defined() instead of using #ifdef or #ifndef in header file.
5
by: PengYu.UT | last post by:
Hi, Would you please let me know where max and min int are defined in C++? Best wishes, Peng
10
by: Jim Langston | last post by:
Is the following well defined? size_t IntVal = 65537; unsigned short Length; if ( IntVal static_cast<unsigned short>( -1 ) ) { std::cout << "Value too long to fit in a short" << std::endl;...
1
by: osmethod | last post by:
Hello, I hope I can be helped again.... Problem: I have a report defined with 4 image controls in the detail section of the report. I have code written which assigns the image path and name...
1
by: Jacek Dziedzic | last post by:
Hello! This is my first time dealing with Very Large Files. I have vector of strings representing numbers and I need to extract bytes in binary mode from a Large File that correspond to...
6
by: jamesrjones | last post by:
I'm writing a template library that models the IEEE754(r) decimal arithmetic standard, and I'd like to provide numeric_limits<for my templates. The problem is that I'm not sure how to do this. ...
1
by: ALiX | last post by:
I'm writing a class where one template parameter must be a type behaving like a floating-point type. Is there a standard way of checking for this? I can come up with two ways of doing this. One...
5
by: user923005 | last post by:
I seem to recall that if a macro is evaluated and the macro is defined, but a value for the macro does not exist, it should be evaluated as zero, but I can't find it in the standard. There is a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.