Looking at >
in Racket, the following makes sense:
> (> 5 0)
#t
Why does the following evaluate to false?
> (> 5 0 0)
#f
Looking at >
in Racket, the following makes sense:
> (> 5 0)
#t
Why does the following evaluate to false?
> (> 5 0 0)
#f
Because (> 5 0 0)
is the same as:
(and (> 5 0) (> 0 0))
...Which is #f
. For comparison, evaluate (>= 5 0 0)
and you'll see that it returns #t
.
Pronounce >
as strictly decreasing and >=
as non-increasing.
Then it becomes easy to see that (> 5 0 0)
is false.
© 2022 - 2024 — McMap. All rights reserved.
0
is not greater than0
but equal. – Headland