4 ms·
> How do you need to extend comparison to account for them? The post already says: −∞ < x < ∞ for all numerical x. (And the mathematician in me clarifies tha
by JadeNB 3y ago
> How do you need to extend comparison to account for them?
The post already says: −∞ < x < ∞ for all numerical x. (And the mathematician in me clarifies that that's all real numerical x.)
- pkolaczk 3y agoI don't remember who said that, but mathematics is all about building abstractions, not about computation. So many times mathematics helped me make code simpler.
- auggierose 3y agoThe post I am replying to made no assumptions about the domain the order is defined on. If it is over the reals, sure, you can use -∞ and ∞. If it is over the integers, you can use MIN_VALUE and MAX_VALUE, sacrificing some of your domain (which might be a problem, depending on the context), or you can use Option[Int], which comes with performance issues. Or, you can use a range which is a sum of three/four cases, and not worry about any of that.
- Rumudiez 3y ago> What are these special open-ended items? > If it is over the reals, sure, you can use -∞ and ∞. If it is over the integers, you can use MIN_VALUE and MAX_VALUE If you already knew the answer, why did you ask?