Skip to main content

diff

Returns the difference between two numbers.

For the absolute difference — i.e. the value without its sign — use absDiff instead.

Parameters

  • X (number)

    The number to subtract from.

  • Y (number)

    The number to subtract.

Examples

ATL in Script

Result

[[diff(9, 7)]]

2

[[diff(7, 9)]]

-2

[[diff(-9, 7)]]

-16

[[diff(9, -7)]]

16

[[diff(-9, -7)]]

-2