using System; using System.Collections.Generic; using System.Reflection.Emit; using System.Text; using Sunweaver.Commands.Attributes; using Sunweaver.DataPrototypes; namespace Sunweaver.Commands.BinaryMath { /// /// Mod returns the remainder after division. It follows this formula: /// a b div = result /// a b mod = remainder /// /// result * b + remainder = a /// [BasePair] public class mod : Abstracts.BinaryOperation { public override void Operation(long a, long b) { if (b != 0) VM.Stack.Push(a % b); else VM.Stack.Push(a); } public override void CompileOperation(ILGenerator il, Locals locals) { throw new NotImplementedException(); } } }