C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Defect Report : numeric_limits::is_modulo insufficently defi

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Chris Jefferson
Guest





PostPosted: Fri Nov 10, 2006 5:14 pm    Post subject: Defect Report : numeric_limits::is_modulo insufficently defi Reply with quote



Apologises that I recently posted this in the wrong group
(comp.lang.c++). This message I believe sums up the recent discussion
in comp.std.c++ on this issue. Exactly what value is most useful for
most compilers to give this flag was still being debated, but that is
not the problem here.

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

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Maarten Kronenburg
Guest





PostPosted: Sat Nov 11, 2006 12:14 am    Post subject: Re: Defect Report : numeric_limits::is_modulo insufficently Reply with quote



"Chris Jefferson" wrote in message
Quote:
Apologises that I recently posted this in the wrong group
(comp.lang.c++). This message I believe sums up the recent discussion
in comp.std.c++ on this issue. Exactly what value is most useful for
most compilers to give this flag was still being debated, but that is
not the problem here.

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


Currently I am working on a small proposal titled:
"Proposal for exact specification of is_modulo".
I'm not sure when a proposal is required or when
a defect report is sufficient.
Anyway, my small proposal suggests the formula
x = x_min + ( ( x - x_min ) mod ( x_max - x_min + 1 ) )
which amounts to the same as your wording.
In my proposal I will add your wording as extra explanation.

Quote:
---



---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Gennaro Prota
Guest





PostPosted: Sat Nov 11, 2006 7:47 am    Post subject: Re: Defect Report : numeric_limits::is_modulo insufficently Reply with quote



On Fri, 10 Nov 2006 11:14:26 CST, Chris Jefferson wrote:

Quote:
Apologises that I recently posted this in the wrong group

And now that you posted it in the right group... no "forwarded" note,
once again. I've lost track of how many of such posts haven't reached
the committee. At least three from me, and really a lot from other
contributors.
--
Gennaro Prota
[To mail me, remove any 'u' from the provided address]

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Howard Hinnant
Guest





PostPosted: Sat Nov 11, 2006 8:07 am    Post subject: Re: Defect Report : numeric_limits::is_modulo insufficently Reply with quote

In article <ahaal2pm46mgrnmgpc6332de0eckvbsl1e (AT) 4ax (DOT) com>,
geunnaro_pruota (AT) yahoo (DOT) com (Gennaro Prota) wrote:

Quote:
On Fri, 10 Nov 2006 11:14:26 CST, Chris Jefferson wrote:

Apologises that I recently posted this in the wrong group

And now that you posted it in the right group... no "forwarded" note,
once again. I've lost track of how many of such posts haven't reached
the committee. At least three from me, and really a lot from other
contributors.

I picked this one up today and created LWG issue 612. If there are
others that have slipped through the cracks, please feel free to email
me directly (if you do not want public comment on it).

Don't forget: we're all just a bunch of volunteers as far as the C++
committee is concerned. Just keep pinging us and we'll try to do better
as time permits. Perhaps you could even better the system by creating a
queue of issues you see as proposed, but not yet processed by the
committee (just a thought). Anyway, we're trying, and overwhelmed, and
falling behind, and all help is welcomed.

Howard Hinnant
LWG Chairman

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.