Problems using modulo

G

Griff

Mike,

Thanks for this. I haven't used %r before, in fact it doesn't even
seem to be mentioned in my "Python Essential Reference" book so I
probably wouldn't have come across it for ages.

I've since tried to run a similar piece of code on my 'C' compiler and
pretty quickly discovered/remembered that C doesn't allow you to do
modulo operations on floats full stop ... so I regard whatever Python
gives us as a bonus!

The quickest workaround I've found is to do
( round(t,5) % round(interval,5)) which seems to give the results I
need.

cheers

- Griff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top