« first day (1299 days earlier)      last day (236 days later) » 

4:02 PM
is there any <=>/three-way operator in ngn/k ?
 
 
2 hours later…
6:32 PM
@TKirishima what do you mean by "three-way operator"?
 
Something like <=> in Ruby or PHP
a <=> b :=
if a < b then return -1
if a = b then return 0
if a > b then return 1
if a and b are not comparable then return nil
 
you could adapt the classic "signum" idiom {(x>0)-(x<0)}
I don't think there's any built-in that does that
 
@coltim (x>0)-x<0 also work.
 
 
4 hours later…
11:03 PM
has a binary search vibe to it
 
11:31 PM
0 1'x works for integers.
 

« first day (1299 days earlier)      last day (236 days later) »