Main Menu

search

You are here

Arduino: Math Operations

[last updated: 2023-07-08]
Arduino home page
Arduino programming - main page
-----

  • Arithmetic Operators:
    % (remainder)
          remainder = dividend % divisor
          dividend & divisor must be integers
          divisor cannot be zero

    * (multiplication)
    + (addition)
    - (subtraction)
    / (division)
    = (assignment operator)

  • Functions:
    • round(); ... standard C function, not officially documented as working in Arduino ...
    • max(var1, var2); ... returns value of the largest of the two vars
    • min(var1, var2); ... returns value of the smallest of the two vars
    • highByte(x); ... takes x as a value of any data type, and returns the byte that is the left-most byte of a 16-bit word,
      or the second lowest byte of a larger data type.

.

.

.

eof