verylsi
Full Member level 2
Dear All,
I was going through Mod and Rem function in VHDL and this is what I got -
5 mod 3 = 2
(-5) mod 3 = 1
5 mod (-3) = -1
(-5) mod (-3) = -2
whereas
5 rem 3 = 2
(-5) rem 3 = -2
5 rem (-3) = 2
(-5) rem (-3) = -2
While rem function gives the expected result but MOD function Jolt out my concepts of a Mod function...
Can anyone please explain?
Thanks
I was going through Mod and Rem function in VHDL and this is what I got -
5 mod 3 = 2
(-5) mod 3 = 1
5 mod (-3) = -1
(-5) mod (-3) = -2
whereas
5 rem 3 = 2
(-5) rem 3 = -2
5 rem (-3) = 2
(-5) rem (-3) = -2
While rem function gives the expected result but MOD function Jolt out my concepts of a Mod function...
Can anyone please explain?
Thanks