Glad you got there in the end :-)
I only implemented the API that MAPM provides... (means I don't have to think too hard!)
Anyhoo, how's about this for now :
I suppose we could have a built-in version of it :-)
I only implemented the API that MAPM provides... (means I don't have to think too hard!)
Anyhoo, how's about this for now :
SuperStrict Framework BaH.MAPM Import BRL.StandardIO Function modulo:TMAPM(x:TMAPM, modY:TMAPM) Local a:TMAPM = x.IntegerDivide(modY) Local b:TMAPM = a.Multiply(modY) Return x.Subtract(b) End Function Function showMod(x:String, y:String) Print x + " mod " + y + " = " + modulo(New TMAPM.Create(x), New TMAPM.Create(y)).ToIntString() End Function showMod(20, 7) showMod(7, 20) showMod(144, 12) showMod(360, 17)
I suppose we could have a built-in version of it :-)