Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Fred K <fred.l.kleinschmidt@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: question regarding % operator. |
| Date | 2012-03-12 07:24 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <2487285.341.1331562256280.JavaMail.geo-discussion-forums@yner4> (permalink) |
| References | <5cd1384f-dadd-4f6f-abcb-dafe20b3498a@qb4g2000pbb.googlegroups.com> <jjkpsv$b5i$1@dont-email.me> <0abfe2cd-dfdf-4dd8-b17f-f34686ee29b8@y27g2000yqy.googlegroups.com> <4F5E0514.5030505@verizon.net> |
On Monday, March 12, 2012 7:15:48 AM UTC-7, James Kuyper wrote: > On 03/12/2012 10:02 AM, somenath wrote: > > On Mar 12, 5:23 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote: > ... > >> Division must now "round toward zero," always. Nowadays, -7 / 3 > ... > > So in case of 7/3 there also exist choices. It can be either 2 or 3. > > But in C it is 2. So does it mean the choice was made to round toward > > zero? > > Well, yes - that is precisely what he said. Not necessarily - for positive numbers, "round toward zero" and "round toward negative infinity" always produce the same result. On Monday, March 12, 2012 7:15:48 AM UTC-7, James Kuyper wrote: > On 03/12/2012 10:02 AM, somenath wrote: > > On Mar 12, 5:23 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote: > ... > >> Division must now "round toward zero," always. Nowadays, -7 / 3 > ... > > So in case of 7/3 there also exist choices. It can be either 2 or 3. > > But in C it is 2. So does it mean the choice was made to round toward > > zero? > > Well, yes - that is precisely what he said. On Monday, March 12, 2012 7:15:48 AM UTC-7, James Kuyper wrote: > On 03/12/2012 10:02 AM, somenath wrote: > > On Mar 12, 5:23 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote: > ... > >> Division must now "round toward zero," always. Nowadays, -7 / 3 > ... > > So in case of 7/3 there also exist choices. It can be either 2 or 3. > > But in C it is 2. So does it mean the choice was made to round toward > > zero? > > Well, yes - that is precisely what he said. On Monday, March 12, 2012 7:15:48 AM UTC-7, James Kuyper wrote: > On 03/12/2012 10:02 AM, somenath wrote: > > On Mar 12, 5:23 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote: > ... > >> Division must now "round toward zero," always. Nowadays, -7 / 3 > ... > > So in case of 7/3 there also exist choices. It can be either 2 or 3. > > But in C it is 2. So does it mean the choice was made to round toward > > zero? > > Well, yes - that is precisely what he said. On Monday, March 12, 2012 7:15:48 AM UTC-7, James Kuyper wrote: > On 03/12/2012 10:02 AM, somenath wrote: > > On Mar 12, 5:23 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote: > ... > >> Division must now "round toward zero," always. Nowadays, -7 / 3 > ... > > So in case of 7/3 there also exist choices. It can be either 2 or 3. > > But in C it is 2. So does it mean the choice was made to round toward > > zero? > > Well, yes - that is precisely what he said.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
question regarding % operator. somenath <pal_somenath@emc.com> - 2012-03-11 20:17 -0700
Re: question regarding % operator. gordonb.ddi19@burditt.org (Gordon Burditt) - 2012-03-12 02:27 -0500
Re: question regarding % operator. Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-03-12 08:23 -0400
Re: question regarding % operator. somenath <pal_somenath@emc.com> - 2012-03-12 07:02 -0700
Re: question regarding % operator. James Kuyper <jameskuyper@verizon.net> - 2012-03-12 10:15 -0400
Re: question regarding % operator. Fred K <fred.l.kleinschmidt@gmail.com> - 2012-03-12 07:27 -0700
Re: question regarding % operator. James Kuyper <jameskuyper@verizon.net> - 2012-03-12 11:04 -0400
Re: question regarding % operator. somenath <pal_somenath@emc.com> - 2012-03-12 08:43 -0700
Re: question regarding % operator. Robert Wessel <robertwessel2@yahoo.com> - 2012-03-12 11:04 -0500
Re: question regarding % operator. Fred K <fred.l.kleinschmidt@gmail.com> - 2012-03-12 07:24 -0700
Re: question regarding % operator. James Kuyper <jameskuyper@verizon.net> - 2012-03-12 11:24 -0400
Re: question regarding % operator. Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-03-12 20:17 -0400
Re: question regarding % operator. Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-13 16:35 -0700
csiph-web