How we calculate this 1.25%0.5=0.5 I don't enderstand | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How we calculate this 1.25%0.5=0.5 I don't enderstand

1st Aug 2017, 8:17 PM
prence ops13
prence ops13 - avatar
6 Answers
+ 3
It can't be 0.5. It's 0.25. Maybe you typed something wrong.
1st Aug 2017, 9:30 PM
Stamen
Stamen - avatar
+ 3
when you divide 1.25 by 0.5 you get 2 remain 0.25
2nd Aug 2017, 2:06 PM
Nuruddeen Hayatu
Nuruddeen Hayatu - avatar
+ 2
Stamen is correct. % results in the remainder. 0.5+0.5=1.0 .. which leaves a remainder of .25
1st Aug 2017, 9:46 PM
LordHill
LordHill - avatar
+ 2
it's linear
2nd Aug 2017, 9:27 AM
Onyebuchi Sunday
Onyebuchi Sunday - avatar
+ 2
yes
5th Aug 2017, 7:01 AM
Nuruddeen Hayatu
Nuruddeen Hayatu - avatar
0
so using the modulo operator gives you just the remainder of the answer? so if the scenario is 5%2, the output is 1?
5th Aug 2017, 2:49 AM
Killian