It looks like the Wire node 'Modulo' gives incorrect values for negative numerator inputs.
Example according to Wolfram Alpha:
11 mod 7 = 4
-11 mod 7 = 3
In Wire:
11 mod 7 = 4 (correct)
-11 mod 7 = -4 (incorrect)
Wire Modulo Node giving incorrect value for negative inputs
-
- Posts: 7
- Joined: Fri Oct 14, 2022 07:15
-
- Posts: 7
- Joined: Fri Oct 14, 2022 07:15
Re: Wire Modulo Node giving incorrect value for negative inputs
The correct Modulo result for negative inputs can be achieved in Wire using a few extra logic nodes:
If the Modulo Result is less than 0 then add the denominator to the result.
-11 mod 7 = 3 (correct) 11 mod 7 = 4 (correct)
If the Modulo Result is less than 0 then add the denominator to the result.
-11 mod 7 = 3 (correct) 11 mod 7 = 4 (correct)
Re: Wire Modulo Node giving incorrect value for negative inputs
There are some ways to do mod, looks like wolfram does a different one than Wire.
If you try the same in Processing you get the same result as in Wire.
If you try the same in Processing you get the same result as in Wire.
Software developer, Sound Engineer,
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu