Kind/book/U60.abs_diff.kind2
2024-02-21 12:18:31 -03:00

10 lines
218 B
Plaintext

// Returns the absolute difference between two U60s
U60.abs_diff
: ∀(a: #U60)
∀(b: #U60)
#U60
= λa λb
let P = λx(#U60)
let true = #(- b a)
let false = #(- a b)
(~(U60.to_bool #(< a b)) P true false)