+ 1

How come 7%(-3)=-2?

22nd Jan 2017, 2:25 PM
nitesh
4 ответов
+ 1
but i tried it in python2.7 and it give -2.
22nd Jan 2017, 2:38 PM
nitesh
+ 1
according to stackexchange: 7/(-3)=-2.3333... floor(-2.3333...)=-3 -3*-3=9 7-9=-2
23rd Jan 2017, 11:40 AM
nitesh
0
i just tried it and it outputs 1 maybe you used / instead of %
22nd Jan 2017, 2:36 PM
Uran Kajtazaj
Uran Kajtazaj - avatar
0
if you saw that in a challenge I think it's an error. There are many error on challenges
22nd Jan 2017, 2:37 PM
Jairo Reyes
Jairo Reyes - avatar