From 2128156624388015491
X-Google-Thread: f78e5,c063db358aabf0d8
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "Maarten Kronenburg" <M.Kronenburg@inter.nl.net>
Newsgroups: comp.std.c++
Subject: Re: Integer division specification
Date: Sun, 18 Feb 2007 21:35:35 CST
Organization: InterNLnet Usenet News service
Lines: 38
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <45d8adcb$0$7365$19deed1b@news.inter.NL.net>
References: <n5u5t219ouhheqn399kchuhhrd3jm7er69@4ax.com> <k9odt25148b6olt421jip03kqqbcq4meo1@4ax.com>
X-Trace: 1171828172 news.inter.NL.net 7365 217.149.216.221:3025
X-Complaints-To: abuse@inter.NL.net
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
X-Virus-Check: ClamAV 0.86.2/2596 on emr1.eu.uu.net; Sun, 18 Feb 2007 19:49:37 +0000
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news2.google.com comp.std.c++:5626


"Gennaro Prota"  wrote
> >I was wondering if, as part of the synchronization with C99, the C++
> >standard is going to require truncation towards zero for integer
> >division or continue to allow the same choice as C90.
>
> Well, let me please do another attempt at getting a reply. I have a
> defect report concerning the specification of operator / and the
> proposed resolution would depend on whether truncation "towards -inf"
> is allowed or not.
>
> It would help everyone, not least the committee which would have to
> examine the DR, to know the answer to this (if it is already known
> :-)).
>
Genny,
Of course also I don't know the answer of this, because somewhere in the
world there may be hardware with a compiler where truncation is not towards
zero. All I know is that at least on x86 the truncation is toward zero. When
the truncation is toward -inf, then technically the remainder becomes the
modulo.
In document N2134, 5.6 [expr.mul], it says "the sign of remainder is
implementation defined" with footnote 78: "According to work underway ...
the quotient is always rounded toward zero."
The problem of course is how to know if there are compilers with hardware
not truncating toward zero. So the solution may then be to have a list of
e-mail addresses of compiler vendors who can answer that question for you,
then you could check all the compiler vendors and ask them personally. When
they wouldn't respond then at least they had the opportunity to object.
Regards, Maarten.


---
[ 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                      ]



