Hacker News new | ask | show | jobs
by reaktivo 1409 days ago
One thing that I haven't found supported in other calculators is returning the min or max between two values
1 comments

If you have abs(), you can use the following as a fallback:

min(a, b) = (a + b - abs(a − b)) / 2

max(a, b) = (a + b + abs(a − b)) / 2