| 1 | initial version |
I think "a in RR" is what you want to use. Your first attempt could work too, using a try/except block.
For testing integrality, or rationality, "in ZZ" and "in QQ" work similarly.
And if you know the numbers you're checking are complex, you could also test to see whether their imaginary parts are zero.
| 2 | add doc for .imag |
I think "a in RR" is what you want to use. Your first attempt could work too, using a try/except block.
For testing integrality, or rationality, "in ZZ" and "in QQ" work similarly.
And if you know the numbers you're checking are complex, you could also test to see whether their imaginary parts parts are zero.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.