query
On this page

compare

lib.compare

Docs pulled from | This Revision | 10 minutes ago


C-style comparisons

a < b, compare a b => -1 a == b, compare a b => 0 a > b, compare a b => 1

Inputs

a

1. Function argument

b

2. Function argument

(lib.trivial.compare)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

compare = a: b:
    if a < b
    then -1
    else if a > b
         then 1
         else 0;