+1

# Print (-11//3)

How can to get output (-4)

+2

Maybe the actual result is -3.5x so python will automatically round up

+2

Actually in python there are two division rules * Ordinary division, with / operator * Floor division, with // operator Here are some explanation to your questions.... These are for perfect division, means which does not give value in decimal >>> 10/2 5 >>>10//2 5 But, for not perfect division >>>10/3 Mathematical result is 3.33333 3 3<3.33333<4 >>>10//3 Mathematical result is 3.33333 3 3<3.3333<4 From above example for not perfect division u can see that floor division means after performing the division, results in the lower integer to the value Therefore, >>> -11//3 -4 -4 < -3.66666 < -3 , from above floor definition it is clear that after division it results in the lower integer to the value that is -4

+2

I understood this point clearly

+2

Thanks

+1

You mean that "//" is round up ok Thanks so much

+1

No, // is floor division

+1

Ok...floored quotient

+1

Mirielle Seb TheS Don't confuse the floor function with the trunc function. By definition, floor(x) returns the largest integer less than or equal to x. In other words, floor(x) rounds down to negative infinity. roza alandalib Please use the search bar before posting to avoid duplicates. https://www.sololearn.com/discuss/461705/?ref=app

+1

Thanks for every one

+1

Diego so what should i call this "//" and check my first comment

+1