[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread agi
I have this: H is a real-valued Matrix z=abs(H[i,j]/H[j,j]) if z!=infinity: print H[i,j], H[i,j].parent() print H[j,j], H[j,j].parent() print z But it doesn't work: H[ 2 , 1 ]= -0.0243252127705267 Real Field with 53 bits of precision H[ 1 , 1 ]= 0.000 Real Field with

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread John Cremona
2008/9/4 agi [EMAIL PROTECTED]: I have this: H is a real-valued Matrix z=abs(H[i,j]/H[j,j]) if z!=infinity: print H[i,j], H[i,j].parent() print H[j,j], H[j,j].parent() print z But it doesn't work: H[ 2 , 1 ]= -0.0243252127705267 Real Field with 53 bits of precision H[ 1 ,

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread David Philp
On 04/09/2008, at 8:22 PM, agi wrote: Hi, I want to check if a number is set to infinity or NaN. So I tried this if-statement: if x!=infinity: print x But this doesn't work when x=a/b with a very small b, so that x becomes infinity. (I'm using SAGE Version 3.0.1) If x = 1.0/0 and

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread John Cremona
2008/9/4 David Philp [EMAIL PROTECTED]: On 04/09/2008, at 8:22 PM, agi wrote: Hi, I want to check if a number is set to infinity or NaN. So I tried this if-statement: if x!=infinity: print x But this doesn't work when x=a/b with a very small b, so that x becomes infinity. (I'm

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread Jason Merrill
On Sep 4, 7:23 am, John Cremona [EMAIL PROTECTED] wrote: 2008/9/4 David Philp [EMAIL PROTECTED]: I think this is better: http://sagemath.org/doc/ref/module-sage.rings.real-mpfr.html since RDF (double precision reals) is deprecated.  Again, look for is_infinity. John Cremona RDF is

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread John Cremona
2008/9/4 Jason Merrill [EMAIL PROTECTED]: On Sep 4, 7:23 am, John Cremona [EMAIL PROTECTED] wrote: 2008/9/4 David Philp [EMAIL PROTECTED]: I think this is better: http://sagemath.org/doc/ref/module-sage.rings.real-mpfr.html since RDF (double precision reals) is deprecated. Again, look

[sage-support] Re: if-statement with infinity or NaN

2008-09-04 Thread agi
It works with not z.is_infinity(). Thanks :) --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at