Comment by NotAnOtter
4 days ago
This is super cool.
It seems to break for ranges including 0 though
100 / -1~1 = -3550~3500
I think the most correct answer here is -inf~inf
4 days ago
This is super cool.
It seems to break for ranges including 0 though
100 / -1~1 = -3550~3500
I think the most correct answer here is -inf~inf
I'd argue this is WAI.
It's hard for me to imagine _dividing_ by -1~1 in a real-world scenario, but let's say we divide by 0~10, which also includes zero. For example, we are dividing the income between 0 to 10 shareholders (still forced, but ok).
Clearly, it's possible to have a division by zero here, so "0 sharehodlers would each get infinity". And in fact, if you try to compute 500 / 0, or even 500~1000 / 0, it will correctly show infinity.
But if you divide by a range that merely _includes_ zero, I don't think it should give you infinity. Ask yourself this: does 95% of results of 500 / 0~10 become infinity?