Re: [sage-support] Re: Recognizing real numbers

2015-02-24 Thread William Stein
On Tue, Feb 24, 2015 at 9:56 AM, Ralf Stephan wrote: > On Tuesday, February 24, 2015 at 6:49:57 PM UTC+1, William wrote: >> On Tue, Feb 24, 2015 at 9:31 AM, Ralf Stephan wrote: >> > On Saturday, April 28, 2012 at 6:40:55 PM UTC+2, Volker Braun wrote: >> >> >> >> The floating point "fields" in Sag

Re: [sage-support] Re: Recognizing real numbers

2015-02-24 Thread Ralf Stephan
On Tuesday, February 24, 2015 at 6:49:57 PM UTC+1, William wrote: > On Tue, Feb 24, 2015 at 9:31 AM, Ralf Stephan wrote: > > On Saturday, April 28, 2012 at 6:40:55 PM UTC+2, Volker Braun wrote: > >> > >> The floating point "fields" in Sage (RR or RDF) can represent both > >> infinity and NaN. So y

Re: [sage-support] Re: Recognizing real numbers

2015-02-24 Thread William Stein
On Tue, Feb 24, 2015 at 9:31 AM, Ralf Stephan wrote: > On Saturday, April 28, 2012 at 6:40:55 PM UTC+2, Volker Braun wrote: >> >> The floating point "fields" in Sage (RR or RDF) can represent both >> infinity and NaN. So you'll have to check separately if this is the case. >> Note that "x in RR" c

[sage-support] Re: Recognizing real numbers

2015-02-24 Thread Ralf Stephan
On Saturday, April 28, 2012 at 6:40:55 PM UTC+2, Volker Braun wrote: > > The floating point "fields" in Sage (RR or RDF) can represent both > infinity and NaN. So you'll have to check separately if this is the case. > Note that "x in RR" checks that x can be represented in RR. But then why is p

[sage-support] Re: Recognizing real numbers

2012-05-07 Thread Duc Trung Ha
Of course, x.n().is_real() condition needs to be added as in: http://aleph.sagemath.org/?z=eJxLVLBV0DXUNzTSKshU0FYAs4oLi0o0DM0gIgWZcUZAysjUTBNImegbcyUBtSQWJSfnF2sYaXIlE2GAhpGWpyaqIVwFRZl5JQpJ-fk5Gol6eRqaCoq2Cn6JfgqJeSkKYAG9zOL4otTEHA1NTWTFSeiKk_AoTkZXnIymGAAkrEPy On Monday, May 7, 2012 1:56:21 PM

[sage-support] Re: Recognizing real numbers

2012-05-07 Thread Duc Trung Ha
With very kind & generous help of Robert Samal following solution was proposed: bool(x.n() != NaN) should give out True iff x is a real number. It seems to work: http://aleph.sagemath.org/?z=eJxLVLBV0DXUNzTSKshU0FYAs4oLi0o0DM0gIgWZcUZAysjUTBNImegbcyUBtSQWJSfnF2sYaXJxFRRl5pUoJOXn52gk6uVpaCoo2ir4J

[sage-support] Re: Recognizing real numbers

2012-04-28 Thread Volker Braun
The floating point "fields" in Sage (RR or RDF) can represent both infinity and NaN. So you'll have to check separately if this is the case. Note that "x in RR" checks that x can be represented in RR. On Saturday, April 28, 2012 7:38:44 AM UTC-4, Duc Trung Ha wrote: > > Hola, > > I'm stuck at