Charles Stanhope

Whoa. I didn't realize Python's integer division rounds down towards negative infinity and not towards zero.

>>> -1//2


A little lunch time web searching revealed Guido's take on the history of integer division in Python:

@cstanhope ja!jah! jah! A pattern of 60 one's meant negative zero! :-)

@cstanhope I appreciate that Haskell makes both options available, as different pairs of operators (quot/rem vs div/mod) so you can specify whether you want truncation or floor. Although I always forget which operator has which behavior…

Sign in to participate in the conversation is a a coop-run corner of the fediverse, a cooperative and transparent approach to operating a social platform. We are currently closed to new memberships while we improve our internal processes and policies, and plan to re-open to new folks when that work is complete. [9/2/2018]