Revision history [back]

any way to turmn off error msg when I catch the errors?

trying to check whether a numerical expression is NaN or not. My expression is log(arcsin(e)). If I apply N() on the expression it goes into infinite loop. I try to catch the runtime error. Everything seems to work in the following code except the error message displayed. I do not want that message in output. Any way to turn the error message off.

sage: def number(expr):
....:         try:
....:             n = N(expr)
....:     except (RuntimeError):
....:             n = N(NaN)
....:     return n
....:
sage: expr=log(arcsin(e))
sage: a=number(expr)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
# I do not want the above error message in output
sage: a
NaN
sage: a.is_NaN()
True

 2 No.2 Revision niles 4389 ●22 ●68 ●127 http://nilesjohnson.net/

any way to turmn turn off error msg when I catch the errors?

trying to check whether a numerical expression is NaN or not. My expression is log(arcsin(e)). If I apply N() on the expression it goes into infinite loop. I try to catch the runtime error. Everything seems to work in the following code except the error message displayed. I do not want that message in output. Any way to turn the error message off.

sage: def number(expr):
....:         try:
....:             n = N(expr)
....:     except (RuntimeError):
....:             n = N(NaN)
....:     return n
....:
sage: expr=log(arcsin(e))
sage: a=number(expr)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
# I do not want the above error message in output
sage: a
NaN
sage: a.is_NaN()
True

 3 retagged niles 4389 ●22 ●68 ●127 http://nilesjohnson.net/

any way to turn off error msg when I catch the errors?

trying to check whether a numerical expression is NaN or not. My expression is log(arcsin(e)). If I apply N() on the expression it goes into infinite loop. I try to catch the runtime error. Everything seems to work in the following code except the error message displayed. I do not want that message in output. Any way to turn the error message off.

sage: def number(expr):
....:         try:
....:             n = N(expr)
....:     except (RuntimeError):
....:             n = N(NaN)
....:     return n
....:
sage: expr=log(arcsin(e))
sage: a=number(expr)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
# I do not want the above error message in output
sage: a
NaN
sage: a.is_NaN()
True

 4 retagged tmonteil 20583 ●25 ●146 ●381 http://wiki.sagemath.o...

any way to turn off error msg when I catch the errors?

trying to check whether a numerical expression is NaN or not. My expression is log(arcsin(e)). If I apply N() on the expression it goes into infinite loop. I try to catch the runtime error. Everything seems to work in the following code except the error message displayed. I do not want that message in output. Any way to turn the error message off.

sage: def number(expr):
....:         try:
....:             n = N(expr)
....:     except (RuntimeError):
....:             n = N(NaN)
....:     return n
....:
sage: expr=log(arcsin(e))
sage: a=number(expr)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
# I do not want the above error message in output
sage: a
NaN
sage: a.is_NaN()
True

 5 retagged tmonteil 20583 ●25 ●146 ●381 http://wiki.sagemath.o...

any way to turn off error msg when I catch the errors?

trying to check whether a numerical expression is NaN or not. My expression is log(arcsin(e)). If I apply N() on the expression it goes into infinite loop. I try to catch the runtime error. Everything seems to work in the following code except the error message displayed. I do not want that message in output. Any way to turn the error message off.

sage: def number(expr):
....:         try:
....:             n = N(expr)
....:     except (RuntimeError):
....:             n = N(NaN)
....:     return n
....:
sage: expr=log(arcsin(e))
sage: a=number(expr)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
# I do not want the above error message in output
sage: a
NaN
sage: a.is_NaN()
True