I just want to know,
Why int(a/b) or math.floor(a/b) is not working instead of a//b in this question or in general? What are the cases where using first 2 methods will give different results than a//b?
My solutions links where i have used following methods to code :
- int(a/b) : CodeChef: Practical coding for everyone
- math.floor(a/b) : CodeChef: Practical coding for everyone
- a//b : CodeChef: Practical coding for everyone
Only 3rd one is AC.
I have read this stackoverflow post but it doesn’t explain case of both positive numers : python - Integer division: is a//b == int(a/b) true for all integers a,b? - Stack Overflow