Sweet.apex

  • Docs
  • Tutorials
Docs Menu
  • Sweet.apex Core
    • Transpilation
    • Grammar
    • Command
    • Config
  • Features
    • Action
    • Apex Doc
    • Array Creation
    • Aspect
    • Cast
    • Default Value
    • Enum
    • File
    • Function
    • Identity
    • Injection
    • Lambda
    • Log
    • Mod
    • Not Null
    • Operator
    • Optional
    • Reflection
    • Rethrow
    • Switch
    • Template String
    • Template
    • Script
    • Tagged String
    • Annotation
    • Nullable
    • Var
    • Val
    • Map Access
    • Constructor
    • Transaction
    • Destructure
    • Import Static
    • Pipeline
    • Varargs
    • Patch
    • Import As
  • Plugin Development
    • Feature
    • Test Case

Mod Guide

Mod

Feature Overview

This feature converts % to Math.mod.

Prerequisite

None

Sweet Apex Example

public class ModDemo {
    public static void test() {
        System.debug(1 % 5);
    }
}

Transpiled Apex

public class ModDemo {
    public static void test() {
        System.debug(Math.mod(1, 5));
    }
}

Usage

Contribute on Github! Edit this section.