I'm taking a large integer and dividing it by 5. answer provided by that operation is correct. But when I'm using floor operator then it rounds off it's digit at units place. Rest all digits are same in both cases. Can someone tell what is happening here? Code:
1 import sys
2
3 def gcd(a, b):
4
5 if b > a:
6 a, b = b, a
7
8 if b > 0:
9 return (gcd(a%b, b))
10
11 return a
12
13 def lcm(a, b):
14 return (a*(b//gcd(a, b))) #floor operator
15
16 def lcm2(a, b):
17 return (a*(b/gcd(a, b))) #division operator
18
19 a, b = 226553150, 1023473145
20 print (int(lcm(a, b)))
21 print (int(lcm2(a, b)))
user@ubuntu:~/py$ python3 findlcm.py
46374212988031350
46374212988031352