Hi Nils,

In my experience it often seems like it often seems desirable to have a 
> "field" R that tries to behave a little closer to being a field, but upon 
> closer inspection, the nasty implementation details of floating point 
> numbers will require for any somewhat serious application a special 
> treatment anyway.
>
> Thus, before embarking on the laborious task of trying to program such a 
> field, I recommend you first try to find a non-trivial scenario that would 
> genuinely benefit from this work.
>

Perhaps the constructor of RR should accept a flag specifying whether 
overflow, division by zero, etc. should raise exceptions or silently return 
+/- infinity or NaN.  I think it wouldn't really be that much work (see 
Paul Zimmermann's comment about MPFR internally raising exceptions), 
although I said "a case could be made" and not "I want to implement this".

Anyway, I do think there are realistic possibilities for needless confusion 
when using Sage as a tool to teach people about calculus.  Say I am a 
student who wants to experiment with integration.  It is easy to write some 
Sage code to approximate \int_0^1 f(x) dx using the trapezium rule.  Then 
if I apply this unsuspectingly to f(x) = x^(-1/2), the outcome will be 
infinity (for any step width) since f(0) = infinity.  Since no zero 
division error occurs, I could be led to believe that the value of the 
integral is infinity instead of 2, and I could even "explain" this to 
myself by noticing that f(x) takes the value infinity somewhere.

Peter

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to