+ 1

How is 20//6=3??

9th Feb 2017, 6:26 AM
silencer
silencer - avatar
2 Answers
+ 25
// is floor division. 20/6 is something in decimal *not good in math* and 20//6 is 3 as 6*3=18 Basically it gives integer value.
9th Feb 2017, 6:54 AM
Frost
Frost - avatar
+ 2
// is integer division, which floors the result and returns how much y's fully fit into x for x // y. If you want real division, use single / instead, but remember it returns a float.
9th Feb 2017, 6:53 AM
DotJason