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


Groups > comp.lang.python > #101993 > unrolled thread

Re: How to simulate C style integer division?

Started byRandom832 <random832@fastmail.com>
First post2016-01-22 00:58 -0500
Last post2016-01-22 00:58 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to simulate C style integer division? Random832 <random832@fastmail.com> - 2016-01-22 00:58 -0500

#101993 — Re: How to simulate C style integer division?

FromRandom832 <random832@fastmail.com>
Date2016-01-22 00:58 -0500
SubjectRe: How to simulate C style integer division?
Message-ID<mailman.160.1453442317.15297.python-list@python.org>
Terry Reedy <tjreedy@udel.edu> writes:
> But fails with remainder 0, as others noted.  Lesson: include corner
> cases in validation test.  Anyway, my main point about writing a clear
> spec remains true.

My validation test for this was to loop both numerator and denominator
from -5 to 5 (skipping denominator 0) to cover all cases (comparing
against the original post's unoptimized code) without having to think
about a minimal set to cover them.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web