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.