Re:The Evil Within the Comparison Functions
by dragonwriter on Monday February 19, 2018 @11:50AM
(#16413939)
> Booleans and branching don't handle this.
Branching handles it fine, with the right conditions. As long as you remember that there are four outcomes and code intentionally for all four, you are golden.
You can do isnan() testing on all values before comparing and branch on that, or you can just do, e.g.:
if x > y ...
elsif x ≤ y ...
else ...
What is most clear and appropriate is context dependent.
Branching handles it fine, with the right conditions. As long as you remember that there are four outcomes and code intentionally for all four, you are golden.
You can do isnan() testing on all values before comparing and branch on that, or you can just do, e.g.:
What is most clear and appropriate is context dependent.