•
Contents
•
Up
•
Test
•
The distance between two numbers
x
and
y
on the number line is |
x
-
y
|. Write a definition of function absdiff(
x
,
y
), which returns |
x
-
y
|. (Recall that abs(
v
) is the absolute value of
v
.)
Answer
Store
Compute
[
Language:
Cinnameg
Kind:
function definition*]
(*You can define more than one function if you put a semicolon between definitions (but not between cases of one definition). Be sure to define a function before you use it.)