Welcome Guest. Please Login or Register. Apr 5th, 2018, 10:01pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Division by zero!
« Thread started on: Aug 27th, 2016, 8:39pm »
I have come across an annoying problem. When trying to calculate an angle using ATN I get a divide by zero error. I know that the error is correct because the second variable is zero, but surely the code should return 90degrees.
angle=ATN(var1/var2)
If var2=0 then the error occurs. I know that what is in the brackets is a division by zero, but how do I get round this problem?
Ric
Sorry, forgot to say var1 is the opposite and Var2 is the adjacent.
They are always changing.
P.S. I'd rather not solve it by error trapping or testing for zero.