+ 2

What is //?

// meaning

16th Feb 2017, 7:16 AM
Rahul Sen
Rahul Sen - avatar
2 Respuestas
+ 47
// means floor division. it basically checks how many times a number can be divided by another number : and the remainder, if any, is usually disregarded. e.g 41//6 = 6 36//6 = 6 but -41//6 = -7 -36//6 = -6
16th Feb 2017, 7:29 AM
<^>washika D<^>
<^>washika D<^> - avatar
+ 8
Works a bit counterintuitive for negative numbers, though. -36//6 = -6 -41//6 = -7 Anyhow, it always returns a result of integer type.
16th Feb 2017, 7:33 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar