Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Added is_integer() function to QQbar.py
Browse files Browse the repository at this point in the history
  • Loading branch information
3shv committed Feb 13, 2014
1 parent 36fab41 commit 4a87fae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/sage/rings/qqbar.py
Expand Up @@ -3289,6 +3289,17 @@ def is_square(self):
else:
return True

def is_integer(self):
"""Return True if this number is a integer
EXAMPLES::
sage: QQbar(2).is_integer()
True
sage: QQbar(1/2).is_integer()
False
"""
return self in ZZ

def sqrt(self, all=False, extend=True):
"""
Return the square root(s) of this number.
Expand Down

0 comments on commit 4a87fae

Please sign in to comment.