On 2014-09-26 13:18, Peter Bruin wrote:
It is completely sensible for valuation(0)
to result in an error (or a "useless" infinity return value)
Raising an error and returning a "useless" infinity value are *very* different things. The first gives an error immediately such that you know where the "problem" lies, with the second you need to track down where the infinity came from.

What I meant is that by allowing arithmetic with infinity, you could
easily mask actual mathematical mistakes, due to the fact that there
is hardly any property of infinity/ies that is valid in every case.
I really think the situation isn't as bad as you (or Bill on pari-dev) describe. Before PARI-2.8, valuation(0,p) returned LONG_MAX and the world didn't collapse. Sage also returns +Infinity for valuation(0,p) and I don't think anybody ever complained about that.

I think my proposed patch is a good middle ground: it allows sufficient arithmetic with oo to be actual useful but it doesn't allow too much, closing a lot of pitfalls. And it keeps old code working.

Explicitly checking for x = 0
in the code inspires more confidence in the correctness of the program
than code that doesn't tell you whether the author ever thought about
the case x = 0.
On the other hand, many mathematical statements involving valuations remain true if you allow 0 and define the valuation of 0 to be +oo with the usual meaning. So why not reflect this in the code?

    So even if upstream never comes around with infinities, we can
    always remove the infinities patch once the scripts have been updated.


Only if nothing else has started to rely on them in the meantime...
If so, that would be further proof that arithmetic with infinities is useful.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to