Can modulus/modulo work on big numbers in python? -


Using a mod at a large number like

600851475143 does not give the right answer, why do anyone know?

  print 600851475143 / 2.0 print 600851475143% 2.0 print 4 / 2.0 print 4% 2.0   

600851475143 / 2.0 = 300425737572.0
600851475143% 2.0 = 1.0
4% 2.0 = 0.0

I was working on creating my own master number function and this is fine for small numbers Works, but it seems to break the modular number gets bigger. I'm just roaming with the dragon and Euler challenge and now beating my head against a wall for a while I ha.

Thank you.

  & gt; & Gt; & Gt; Print 600851475143/2 300425737571 & gt; & Gt; & Gt; Print 600851475143% 2 1> gt; & Gt; 4/2 2 & gt; & Gt; & Gt; 4% 2 0   

In addition to: There is nothing to do with the large number of problems - it is only about executing the integer in Python.

Comments