On Thu, Sep 25, 2008 at 5:33 PM, Quicksilver_Johny
<[EMAIL PROTECTED]> wrote:
>
> If c=sqrt(a^2+b^2)
> How would I check if c is an integer in order to get a true/false
> value.
> I tried is_Integer(ZZ(c)), this returns true when c is an integer, but
> ZZ(c) returns an error when c is not an integer.
Try using Python's try/except:
try:
ZZ(c)
# c is an integer
except TypeError:
# c isn't an integer
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---