Hi there, First of all: "Je n'ai jamais vu que des nombres entiers et encore pas tous !" It probably translate to something like "I've only seen integer numbers, and still, not all of them !" As you certainly have guessed, this means that I'm not a serious user of real numbers... By the way, if someone knows the precise original citation and/or its author, I appreciate if he tell me.
> What should these corner cases return? Do you agree with the current > answers? If RR is suppose to model the set of Real Numbers, I'd say most of then should be wrong: > sage: RR('inf').is_real() > True I have the feeling that is should be false... Note that: sage: RR('inf') == RR(Infinity) True sage: RR(Infinity) == Infinity False > sage: RR('nan').is_real() > True I'm pretty convinced that this should be False ! How "Not A Number" could be a real number :-) ? > sage: RR('inf').is_unit() > True False as well ! Show me the inverse ? > sage: RR('nan').__nonzero__() > False Here I'm pretty tempted to raise a ValueError... If you have a 'nan' you usually want to catch it as soon as possible in you computation. Otherwise I vote for True. > sage: RR('nan')==RR('nan') > True Strange ! in IEEE 753 it is specified as being False. > sage: RR('-inf').__pow(0.5) > +infinity In my opinion, It can't be an acceptable answer... I'd rather raising a ValueError. > note that this is returned by the actual sqrt function: > > sage: sqrt(RR('-inf')) > +infinity*I Idem... > And you probably don't agree with this next one: > > sage: RR('nan').__pow(0.5) > Exception RuntimeError: 'maximum recursion depth exceeded while calling a > Python object' in <type 'exceptions.RuntimeError'> ignored > ^CERROR: Internal Python error in the inspect module. > Below is the traceback from this internal error. > > Traceback (most recent call last): Here again ValueError... As I said, I'm not an engineer, so that I have no use for those corner case. I would be interested to know if there exists a sage user who has one ? If not I'd rather systematically raise a ValueError to catch erroneous computation as soon as possible. Just my 1/RR('inf') cents ;-) Cheers, Florent -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org