Class RuntimeArithmetic

java.lang.Object
io.github.protasm.jvmud.compiler.runtime.RuntimeArithmetic

public final class RuntimeArithmetic extends Object
Runtime arithmetic helpers for dynamically typed LPC expressions.
  • Method Details

    • add

      public static Object add(Object left, Object right)
      Adds two dynamic LPC values.

      LPC mudlibs often combine values returned from object calls before the compiler can know whether they are numbers or strings. JVMud preserves that late choice here: numeric pairs add numerically, while either text operand produces string concatenation.

    • subtract

      public static Object subtract(Object left, Object right)
      Subtracts two dynamic LPC values.

      Runtime strings and arrays use LPC's difference operators. Numeric pairs subtract numerically. Other pairs are rejected so incompatible dynamic values fail loudly instead of being silently coerced into unrelated behavior.