Curious question - how does the VM actually do an integer mod operation?
There does not appear to be an ‘imod’ bytecode, and the ‘idiv’ doesn’t return the modulus (although I don’t know of any processor that doesnt return the mod when it does an integer divide).
I just so happen to want to do a divide and a mod at the same time, and I don’t particularly wish to do:
int div = a / b;
int mod = a - (div*b);
Any suggestions?
- Dom
PS: This is in a loop I am looking at running >5000 times a frame, so I would really like to do it quite quickly