#10774: RuntimeError message for numerical infinite loop is printed, not thrown
-------------------------+--------------------------------------------------
   Reporter:  niles      |       Owner:  jason, jkantor                       
       Type:  defect     |      Status:  new                                  
   Priority:  major      |   Milestone:                                       
  Component:  numerical  |    Keywords:  RuntimeError numerics recursion-depth
     Author:             |    Upstream:  N/A                                  
   Reviewer:             |      Merged:                                       
Work_issues:             |  
-------------------------+--------------------------------------------------
 Reported in [http://ask.sagemath.org/question/375/any-way-to-turn-off-
 error-msg-when-i-catch-the this question] at Ask Sage, there is a bug in
 some infinite loops which causes a `RuntimeError` to be printed, but not
 thrown as an exception.  This means it cannot be caught by `try/except`
 blocks.

 {{{
 def number(expr):
     try:
         n = N(expr)
     except RuntimeError:
         n = 0
     return n
 }}}

 {{{
 sage: expr=log(arcsin(e))
 sage: a=number(expr)
 Exception RuntimeError: 'maximum recursion depth exceeded in
 __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
 sage: a
 0
 }}}

 Similar problems are reported with `N(log(NaN))`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10774>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to