Rungsrungs.dev
DocsBlogExercises
> run studio> run studio.rungs.dev
← All courses

Math and Comparison

Arithmetic, limits and comparing values

Move beyond on/off. Compare two values, work with signs and magnitudes, wrap with modulo, hold a result inside a safe range, then apply signed math to a drive reference.

  1. 0

    // Evaluates a numeric input and sets a flag indicating if it is negative, zero, or positive.

    Sign Check

    EXERCISE
    Difficultyeasy
    Status—unknown
  2. 1

    // Compares two numeric inputs and outputs Less, Equal, and Greater flags.

    Compare Pair

    EXERCISE
    Difficultyeasy
    Status—unknown
  3. 2

    // Outputs the absolute value of a numeric input.

    Absolute Value

    EXERCISE
    Difficultyeasy
    Status—unknown
  4. 3

    // Outputs the remainder of dividing the dividend by the divisor.

    Modulo

    EXERCISE
    Difficultyeasy
    Status—unknown
  5. 4

    // Outputs the square root of a REAL input's magnitude.

    Square Root

    EXERCISE
    Difficultyeasy
    Status—unknown
  6. 5

    // Constrains a numeric value between 0 and 100.

    Clamp

    EXERCISE
    Difficultyeasy
    Status—unknown
  7. 6

    // Passes a signed speed reference through, or flips its sign when the reverse command is on.

    Reverse Speed Reference

    EXERCISE
    Difficultyeasy
    Status—unknown
  8. End
Previous course← CountersNext courseAnalog and Scaling →

Product

  • PLC Simulator
  • Exercises
  • Courses
  • Pricing

Learn

  • Learn PLC Programming
  • Documentation
  • Ladder Logic
  • Structured Text
  • Blog

Community

  • Discussions
  • Contact

Legal

  • Privacy Policy
  • Terms and Conditions
  • Refund Policy
  • Cookie settings
© 2026 Techsolid Automation Limited