Dvision with remainders
Blitz3D Forums/Blitz3D Beginners Area/Dvision with remainders
| ||
How do you do division, but instead of decimals, use remainders? |
| ||
Mod returns the remainder of a division, is that's what you mean. |
| ||
I know I’m probably doing something easy to figure out wrong, but I don’t know how to use mod and I’m wondering why the remainder is 0 when I try to do this: (num1=10 and num2=3) num1=Input("First Number: ") num2=Input("Second Number: ") answer=num1/num2 Print answer + " r" + num1/num2 Mod 3 Delay 5000 End |
| ||
I think you simply take the mod then subtract it from the original first number and divide normal then put it in text Like This: num1=Input("First Number: ") num2=Input("Second Number: ") Nummod = num1 mod num2 ;Divides num1 by num2 as many times as possible and returns remainder num1 = num1 - nummod answer = num1/num2 print answer+ " r"+NumMod |
| ||
? 10 Mod 2 = 0 10 Mod 3 = 1 10/3 Mod 3 = 3 mod 3 = 0 |