is there a way to return the current angle type (degree/radian) without actually changing that?

I want to make an if statement to warn users if they are in degrees instead of radians.
Sure, you can just do something like this:

Code:
Prgm
If 5°=5 Then
Disp "DEG"
Else
Disp "RAD"
EndIf
EndPrgm
To check for if a user is using degrees instead of radians, just look to see if the value is greater than a certain multiple of tau.

Or... just multiply by pi/180 if the answer is not a rational multiple of pi;.

Edit: oh instead just set K to 1 then if womp's code returns radians, or pi/180 if it returns degrees. Every time you have a degree, multiply it by K.
You should check if 1ʳ=1, which will be true in RADIAN mode but not in DEGREE or GRADIAN mode, if you specifically want to warn the user if not in radian mode. If you want them to not be in degree mode but either of the others is fine, you could instead check if 1°=1 like mr womp womp suggested. (& similarly, 1ᴳ=1 is the check for gradian mode specifically.) I think they added gradians later than the original TI-89, but you should account for it anyway in case people run your program on a TI-89 Titanium.

(There may also be another way to check by reading the mode settings directly, but that seems needlessly complicated.)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement