Your question is not very well posed. If you divide by a small number, you may get a large result but never infinity!
sage: x= 1.2/0.0000000000000000000000000000000000000000000000000000000001 sage: x 1.20000000000000e58 sage: x==infinity False sage: x!=infinity True sage: x=1/0 --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) /home/john/<ipython console> in <module>() /home/john/element.pyx in sage.structure.element.RingElement.__div__ (sage/structure/element.c:9865)() /home/john/coerce.pxi in sage.structure.element._div_c (sage/structure/element.c:17192)() /home/john/integer.pyx in sage.rings.integer.Integer._div_c_impl (sage/rings/integer.c:9324)() /home/john/integer_ring.pyx in sage.rings.integer_ring.IntegerRing_class._div (sage/rings/integer_ring.c:4411)() ZeroDivisionError: Rational division by zero 2008/9/4 agi <[EMAIL PROTECTED]>: > > 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) > > > Agi > > > > --~--~---------~--~----~------------~-------~--~----~ 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 http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---