Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101954

Re: How to simulate C style integer division?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: How to simulate C style integer division?
Date Thu, 21 Jan 2016 01:43:47 -0800
Organization A noiseless patient Spider
Lines 6
Message-ID <87io2np8rw.fsf@nightsong.com> (permalink)
References <CAJQX3DyoDUtNWbNEpGVJxeKATADWAikP47NRZb7+UaxSwSRZaQ@mail.gmail.com> <mailman.143.1453367498.15297.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="560a36ee31cc4bcf69e115b311f0cc5c"; logging-data="15749"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19k5c6fj9PAWeBx4VqTvy9a"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:YHUivbmmvJG3M+eGikFLGpAi4ps= sha1:dp13JJex+B/7Rp+0Bk8VStHG8Yk=
Xref csiph.com comp.lang.python:101954

Show key headers only | View raw


Ben Finney <ben+python@benfinney.id.au> writes:
> I'm not sure I know exactly what behaviour you want (“C style” may mean
> different things to each of us).

I thought he meant trunc-division, so -5 / 2 = -2 and -5 % 2 = -1.
Python specifies floor division but C leaves it unspecified, I thought.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: How to simulate C style integer division? Ben Finney <ben+python@benfinney.id.au> - 2016-01-21 20:11 +1100
  Re: How to simulate C style integer division? Paul Rubin <no.email@nospam.invalid> - 2016-01-21 01:43 -0800
    Re: How to simulate C style integer division? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-01-21 11:58 +0200
  Re: How to simulate C style integer division? Steven D'Aprano <steve@pearwood.info> - 2016-01-21 23:42 +1100
    Re: How to simulate C style integer division? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-01-21 16:00 +0200
      Re: How to simulate C style integer division? Marko Rauhamaa <marko@pacujo.net> - 2016-01-21 16:31 +0200
        Re: How to simulate C style integer division? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-01-21 16:48 +0200
        Re: How to simulate C style integer division? Random832 <random832@fastmail.com> - 2016-01-21 14:52 -0500
          Re: How to simulate C style integer division? Marko Rauhamaa <marko@pacujo.net> - 2016-01-21 23:17 +0200
            Re: How to simulate C style integer division? Matt Wheeler <m@funkyhat.org> - 2016-01-22 00:51 +0000
      Re: How to simulate C style integer division? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2016-01-21 15:22 +0100

csiph-web