Re: [Tutor] modulo

2012-10-17 Thread Jan Karel Schreuder
On Oct 7, 2012, at 8:06 PM, Dave Angel wrote: > On 10/07/2012 08:00 PM, Jan Karel Schreuder wrote: >> >> >> On Oct 7, 2012, at 7:24 PM, Dave Angel wrote: >> >> > >>> >>> It still makes no sense to me. There are at least two equally silly >>> ways to define the results of a nega

Re: [Tutor] modulo

2012-10-17 Thread Dwight Hutto
__ >>> I'm not a professional programmer, so I might be way off base here. You mean you haven't dealt with this subject yet... But what I like about Pythons modulo solution is that I can use it to right and left shift in lists or tuples, and I will link

Re: [Tutor] modulo

2012-10-07 Thread wrw
On Oct 7, 2012, at 6:49 PM, Esteban Izaguirre wrote: > Hi, I'm following coursera's learn to program: the fundamentals, which > teaches programming basics in python. Our first assignement involves the > modulo operator with a negative divident, and while I've managed to get to > understand it

Re: [Tutor] modulo

2012-10-07 Thread Dave Angel
On 10/07/2012 08:00 PM, Jan Karel Schreuder wrote: > > > On Oct 7, 2012, at 7:24 PM, Dave Angel wrote: > > >> >> It still makes no sense to me. There are at least two equally silly >> ways to define the results of a negative modulus, and you've properly >> described one of them, presu

Re: [Tutor] modulo

2012-10-07 Thread Dave Angel
On 10/07/2012 07:16 PM, Oscar Benjamin wrote: > On 8 October 2012 00:07, Dave Angel wrote: >> On 10/07/2012 06:49 PM, Esteban Izaguirre wrote: >>> Hi, I'm following coursera's learn to program: the fundamentals, which >>> teaches programming basics in python. Our first assignement involves the >>>

Re: [Tutor] modulo

2012-10-07 Thread Oscar Benjamin
On 8 October 2012 00:07, Dave Angel wrote: > On 10/07/2012 06:49 PM, Esteban Izaguirre wrote: >> Hi, I'm following coursera's learn to program: the fundamentals, which >> teaches programming basics in python. Our first assignement involves the >> modulo operator with a negative divident, and while

Re: [Tutor] modulo

2012-10-07 Thread Steven D'Aprano
Hello Esteban and welcome! On 08/10/12 09:49, Esteban Izaguirre wrote: So, i undertand how modulo works when only positive numbers are used, but how does modulo determine, that, say -15 % 14 is equal to 13? Think of modulo as almost exactly the same as "remainder after division". When you sa

Re: [Tutor] modulo

2012-10-07 Thread Dave Angel
On 10/07/2012 06:49 PM, Esteban Izaguirre wrote: > Hi, I'm following coursera's learn to program: the fundamentals, which > teaches programming basics in python. Our first assignement involves the > modulo operator with a negative divident, and while I've managed to get to > understand it enough fo

[Tutor] modulo

2012-10-07 Thread Esteban Izaguirre
Hi, I'm following coursera's learn to program: the fundamentals, which teaches programming basics in python. Our first assignement involves the modulo operator with a negative divident, and while I've managed to get to understand it enough for the purposes of the assignement with help from othe rst

Re: [Tutor] Modulo operator (was no subject)

2006-11-28 Thread Bob Gailer
See http://en.wikipedia.org/wiki/Modular_arithmetic for a comprehensive discussion. Especially the paragraph title Remainders. Often people ask "what's the practical use of modular arithmetic?" Consider how we tell time... -- Bob Gailer 510-978-4454 __

Re: [Tutor] Modulo operator (was no subject)

2006-11-28 Thread Bob Gailer
Please always provide a subject line. Otherwise it is very hard to follow threads. Noufal Ibrahim wrote: > Kopalle Narasimha wrote: > >> Hello, Everyone. >> >> I have a strange problem with floating point numbers. Please help me. >> I tried the following at the python prompt: >> >> Case 1: >>