The REALLY bad thing about Python lists ..

Robin Becker robin at jessikat.demon.co.uk
Tue May 23 10:02:23 EDT 2000


In article <392A8035.5C2A2BAA at home.com>, Ivan Van Laningham
<ivanlan at home.com> writes
>Hi All--
>
....
>> (Under what circumstances would you want to use % on negative numbers?
>> I can't think of any.)
>> 
>
>Calendrical mathematics often has a use for negative modulo.  However,
>it's an easy matter to check the inputs and set the sign on the answer.
>...
>
><zero-minus-one>-ly y'rs,
>Ivan
...
also many algorithms want to do angle = angle % 360 and expect something
in the range 0-359.99999999...
-- 
Robin Becker



More information about the Python-list mailing list