difference

Syntax

difference(X)

Arguments

X is a scalar/vector.

Details

Return the last element minus the first element of a vector. If X is a scalar, it returns 0.

Examples

difference(2 4 2);
// output
0

difference(12.3 15.6 17.8);
// output
5.5

difference(278);
// output
0