Class SandboxInt32Math
Checked 32-bit integer arithmetic with sandbox error semantics. Overflow is detected with branchless
bit tests (no closures, no try/catch) so each operation is allocation-free and inlineable on the
compiler's unboxed fast path and the interpreter alike. Every overflow / divide-by-zero raises the same
InvalidInput error as before.
public static class SandboxInt32Math
- Inheritance
-
SandboxInt32Math
- Inherited Members
Methods
Add(int, int)
public static int Add(int left, int right)
Parameters
Returns
Divide(int, int)
public static int Divide(int left, int right)
Parameters
Returns
Multiply(int, int)
public static int Multiply(int left, int right)
Parameters
Returns
Negate(int)
public static int Negate(int value)
Parameters
valueint
Returns
Remainder(int, int)
public static int Remainder(int left, int right)
Parameters
Returns
Subtract(int, int)
public static int Subtract(int left, int right)