I'm prompting the user for a string to represent an angle.
(setq second_angle (getstring "\nWhat angle is the turned pipe sloping? "))
Then, depending on the slash location via:
(setq slashloc (vl-string-position (ascii "/") second_angle))
Getting the rise:
(setq rise (atoi (substr second_angle 1 slashloc)))
And the run:
(setq run (atoi (substr second_angle (+ 2 slashloc))))
Then do the rise/run calculation I get 0.0 returned:
(/ rise run)
So for a rise/run for 1/48, I should/want to have returned is the exact value that I can assign for later use, 1.193489424.
Stumped
KP
Solved! Go to Solution.
Solved by Ajilal.Vijayan. Go to Solution.
When you divide an integer by an integer with the (/) function, you get an integer result. At least one of them needs to be a real number instead. Try using (atof) in place of (atoi).