and it would not make very much sense to provide a method for this
class to test for integrality, since every such element is an Integer
by definition.  I suspect that in your intended application, A will be
the result of come computation resulting in a real number, and you
want to test whether it is (at least approximately) integral.  Here
are some ideas:

You are guessing almost right.
In my case A is an user-given angle value that will be passed to trigonometric functions.
I want to guess if the user gave radiant or degree.
My first test if

if "pi" in repr(A)

I cannot believe that someone will provide an angle with "pi" in degree. In that case, I deal with A as radian.

Then my second test is to see if A is integer. One almost never deal with integer radian. So if the A is integer, I will deal with it as degree.

I'm expecting some problems with degree values given as
pi/2 * 180/pi
(result of a conversion)


But well, up to now my function works :)

Thanks
Laurent

--
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
URL: http://www.sagemath.org

Reply via email to