JanetDocsPlaygroundI'm feeling luckyGitHub sign in

cmp



    function

    (cmp x y)

    Returns -1 if x is strictly less than y, 1 if y is strictly greater 
    than x, and 0 otherwise. To return 0, x and y must be the exact 
    same type.


3 examplesSign in to add an example
Loading...
(cmp 0.0 0)
# => 0
sogaiuPlayground
(cmp [1 2] [1 2 3])
# => -1
sogaiuPlayground
(cmp 1.0 2)
# => -1
sogaiuPlayground