Closed almarklein closed 4 years ago
Also test that these work the same as in Python.
Does that mean some functions work differently than documented in spir-v?
Also test that these work the same as in Python.
Does that mean some functions work differently than documented in spir-v?
The modulo operator has different flavours, and not all programming languages implement the same one. In Python, with %
the result takes the sign of the second argument, whereas math.fmod
takes the sign of the first argument. The latter is also referred to as the "remainder". SpirV supports both. What I meant is that I wrote tests to make sure that using %
and math.fmod
both work and produce the same result as in Python :)
Alright, thanks for clarifying. Follow up question: is the default behaviour for %
in spir-v the same as the Python behaviour for %
?
a % b
andmath.fmod(a, b)
, which both work a bit different. Also test that these work the same as in Python.fragDepth
//
operatora,b=c,d
) as syntactic sugar.