Which is performed 1st .. floor division or module | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Which is performed 1st .. floor division or module

2nd Jul 2017, 5:34 AM
vinayak
2 Answers
+ 7
provide your code if any floor division : 5//2 .. 2 normal : 5/2 .. 2.5 remainder / modulo : 5%2 .. 1
2nd Jul 2017, 5:43 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 3
It's "modulo", not "module" ^^... And if you ask about which operator has more priority, don't more ask yourself, and add some parenthesis (rounded brackets) to write explicit proritized expression rather than trust the uncertain behaviour of interpreter ;P So write: 42 / ( 18 % 11 ) or: ( 42 / 18 ) % 11 rather than: 42 / 18 % 11 Anyway, you can get yourself the answer, by testing all these 3 examples expression, and compare result to see in wich order your interpreter do it ^^
2nd Jul 2017, 6:43 AM
visph
visph - avatar