0

can anyone explain me what is % and //

when iwas learning js ididn't know how 56%3=2 so iskipped it now when I learn python have % and // can any one explain me please or gimme any video link?

19th Mar 2017, 3:11 PM
ZIAD
ZIAD - avatar
3 Respuestas
+ 1
// stands for Floor Division - The division of operands where the result is the quotient in which the digits after the decimal point are removed. But if one of the operands is negative, the result is floored, i.e., rounded away from zero (towards negative infinity) whereas, % stands for modular division i.e. it divides left-hand operand by right-hand operand and returns remainder
19th Mar 2017, 3:21 PM
Mayank Sharma
Mayank Sharma - avatar
+ 1
5//2=2 (floor division) whereas, 5%2=1 ( modular division which gives remainder)
19th Mar 2017, 4:58 PM
Mayank Sharma
Mayank Sharma - avatar
0
can u gimme a example
19th Mar 2017, 4:39 PM
ZIAD
ZIAD - avatar