+ 1

What is floor division?

3rd Sep 2017, 6:34 AM
Rajani Ar
Rajani Ar - avatar
6 Antworten
+ 5
a//b == (a-(a%b))/b
3rd Sep 2017, 6:47 AM
Dapper Mink
Dapper Mink - avatar
+ 4
It removes the decimals of the result
3rd Sep 2017, 6:42 AM
Dapper Mink
Dapper Mink - avatar
+ 4
Floor division is integer division. The floating part or fractional part of the quotient is truncated (cut off) leaving only the integer part of the result. try printing: print(10 / 3) vs print(10 // 3)
3rd Sep 2017, 6:43 AM
ChaoticDawg
ChaoticDawg - avatar
+ 4
a//b == floor(a/b)
3rd Sep 2017, 6:44 AM
Dapper Mink
Dapper Mink - avatar
+ 4
Floor division (//) gives quotient while division (/) gives exact division answer. e. g. 7//2=3 but 7/2=3.5
3rd Sep 2017, 6:44 AM
Lakshay
Lakshay - avatar
+ 4
It returns the floor of the division.
3rd Sep 2017, 6:50 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar