Closed chopin closed 5 months ago
I found that % operator returns a plus value when an operand is minus.
alpha= -2.18 angle= alpha%math.pi print('angle:', angle) angle:0.95
Modulus of a minus operand should return a minus value as following:
-2.18 % 3.14... = -2.18
I checked the javascript code. % operator was translated to mod() function.
var angle = __mod__ (alpha, math.pi);
I found that %(modulus) of Python returns a plus value given a minus operand while Javascript returns minus value.
So, it is not a bug. The current implementation of Transcrypt is correct.
I found that % operator returns a plus value when an operand is minus.
Modulus of a minus operand should return a minus value as following:
-2.18 % 3.14... = -2.18
I checked the javascript code. % operator was translated to mod() function.