Re: negative integer division

2005-02-10 Thread Mark Jackson
[EMAIL PROTECTED] (John Machin) writes: > [EMAIL PROTECTED] (Mark Jackson) wrote in message news:<[EMAIL PROTECTED]>... > > > > A: 42 > > > > Q: What multiple of 7 did I add to the critical expression in the Zeller > > algorithm so it would remain nonnegative for the next few centuries? >

Re: negative integer division

2005-02-10 Thread Mike Meyer
Jive Dadson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> [C] isn't - it's a portable assembler. > > I've heard that many times, but it makes no sense to me. By definition, > the syntax of an assembly language closely resembles the format of > individual hardware instructions for a particula

Re: negative integer division

2005-02-09 Thread John Machin
[EMAIL PROTECTED] (Mark Jackson) wrote in message news:<[EMAIL PROTECTED]>... > > A: 42 > > Q: What multiple of 7 did I add to the critical expression in the Zeller > algorithm so it would remain nonnegative for the next few centuries? What are you calling "the Zeller algorithm", and what

Re: negative integer division

2005-02-09 Thread Carl Banks
Jive Dadson wrote: > > Now, I'll agree with you if you want to argue that some machines do > > negative integer division in stupifyingly horrible ways. > > That's why I think it was a stupifyingly horrible decision. > Understandable, but in the end an s.h.d. nonetheless. C language is chock-full

Re: negative integer division

2005-02-09 Thread Scott David Daniels
Jive Dadson wrote: I've forgotten what we are arguing about, but I'm sure I'm right. ^^^ QOTW --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: negative integer division

2005-02-09 Thread Peter Hansen
Grant Edwards wrote: This is pretty much completely off-topic now. :) No discussion of how lame other languages are is ever completely off-topic in comp.lang.python. After all, these discussions continue to remind us how lucky we all are to be able to program in Python, and that can only be a goo

Re: negative integer division

2005-02-09 Thread Grant Edwards
On 2005-02-09, Jive Dadson <[EMAIL PROTECTED]> wrote: > intentionally I disagree! -- Grant Edwards grante Yow! ... I don't like at FRANK SINATRA or his visi.comCHILDREN. --

Re: negative integer division

2005-02-09 Thread Grant Edwards
On 2005-02-09, Jive Dadson <[EMAIL PROTECTED]> wrote: [C] isn't - it's a portable assembler. >>> >>> I've heard that many times, but it makes no sense to me. >> >> I think the point is that C is a low-level, hardware twiddling >> language to be used by people writing things like kernel code

Re: negative integer division

2005-02-09 Thread Jive Dadson
intentionally -- http://mail.python.org/mailman/listinfo/python-list

Re: negative integer division

2005-02-09 Thread Jive Dadson
Grant Edwards wrote: > > On 2005-02-09, Jive Dadson <[EMAIL PROTECTED]> wrote: > > >> [C] isn't - it's a portable assembler. > > > > I've heard that many times, but it makes no sense to me. > > I think the point is that C is a low-level, hardware twiddling > language to be used by people writi

Re: negative integer division

2005-02-09 Thread Grant Edwards
On 2005-02-09, Jive Dadson <[EMAIL PROTECTED]> wrote: >> [C] isn't - it's a portable assembler. > > I've heard that many times, but it makes no sense to me. I think the point is that C is a low-level, hardware twiddling language to be used by people writing things like kernel code -- something th

Re: negative integer division

2005-02-09 Thread Jive Dadson
Mike Meyer wrote: > > Jive Dadson <[EMAIL PROTECTED]> writes: > > > Python does it right. C is allowed to do it anyway it likes, which was > > a stupifyingly horrible decision, IMHO. > > C only does it wrong if you think that C is a high level language. I didn't say it does it wrong. I sai

Re: negative integer division

2005-02-08 Thread Mike Meyer
Jive Dadson <[EMAIL PROTECTED]> writes: > Python does it right. C is allowed to do it anyway it likes, which was > a stupifyingly horrible decision, IMHO. C only does it wrong if you think that C is a high level language. It isn't - it's a portable assembler. As such, low level things (like this

Re: negative integer division

2005-02-08 Thread Dan Bishop
Mark Jackson wrote: > Imbaud Pierre <[EMAIL PROTECTED]> writes: > > integer division and modulo gives different results in c and python, > > when negative numbers > > are involved. take gdb as a widely available c interpreter > > print -2 /3 > > 0 for c, -1 for python. > > more amazing, modulos o

Re: negative integer division

2005-02-08 Thread Jive Dadson
Python does it right. C is allowed to do it anyway it likes, which was a stupifyingly horrible decision, IMHO. Way back when, there was a language named Pascal. I lobbied the Pascal standards committee to define the modulus operator correctly, which they eventually did. To my astonishment, they

Re: negative integer division

2005-02-07 Thread Mark Jackson
Imbaud Pierre <[EMAIL PROTECTED]> writes: > integer division and modulo gives different results in c and python, > when negative numbers > are involved. take gdb as a widely available c interpreter > print -2 /3 > 0 for c, -1 for python. > more amazing, modulos of negative number give negative v

Re: negative integer division

2005-02-07 Thread Scott David Daniels
Imbaud Pierre wrote: integer division and modulo gives different results in c and python, when negative numbers are involved. take gdb as a widely available c interpreter print -2 /3 0 for c, -1 for python. more amazing, modulos of negative number give negative values! (in c). from an algebraic p

Re: negative integer division

2005-02-07 Thread Robert Kern
Imbaud Pierre wrote: integer division and modulo gives different results in c and python, when negative numbers are involved. take gdb as a widely available c interpreter print -2 /3 0 for c, -1 for python. more amazing, modulos of negative number give negative values! (in c). from an algebraic p

Re: negative integer division

2005-02-07 Thread Skip Montanaro
Imbaud> integer division and modulo gives different results in c and Imbaud> python, when negative numbers are involved. http://www.python.org/doc/faq/programming.html#why-does-22-10-return-3 Skip -- http://mail.python.org/mailman/listinfo/python-list