3 ms·
They could be, but using -∞ makes the abstraction simpler, and it's easy to map -∞ to an error when showing the conformance of the implementation to the abstrac
by pron 2y ago
They could be, but using -∞ makes the abstraction simpler, and it's easy to map -∞ to an error when showing the conformance of the implementation to the abstraction.
- sevensor 2y agoThat’s my point though. Infinity isn’t useful for computation in a lot of cases where numbers are called for and it’s debatable that it even is a number. So it’s already a special error value, and if that’s the case, why use a value that accidentally behaves like a number sometimes?
- pron 2y agoBecause you're not writing a program. You're writing an abstract algorithm and this makes the algorithm slightly simpler to express without losing anything. If you don't like that, you can use a special error value instead even in your abstract description.