projog

4.8. max - finds the maximum of two numbers.

Examples

?- X is max(5,5).
X = 5

yes

?- X is max(7,8).
X = 8

yes

?- X is max(3,2).
X = 3

yes

?- X is max(2.5,2.5).
X = 2.5

yes

?- X is max(2.75,2.5).
X = 2.75

yes

?- X is max(1,1.5).
X = 1.5

yes

?- X is max(2,1.5).
X = 2

yes

?- X is max(-3,2).
X = 2

yes

?- X is max(-3,-2).
X = -2

yes

?- X is max(-2.5,-2.25).
X = -2.25

yes

?- X is max(0,0).
X = 0

yes

?- X is max(0.0,0.0).
X = 0.0

yes

?- X is max(0,0.0).
X = 0.0

yes

?- X is max(0.0,0).
X = 0

yes