- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm attempting to run a function that recognizes a variable as greater than the integer 1. The function looks as simple as this...
(setq z (/ l 240))
(if (> z 1)
(progn.... So on
If the variable that is being pulled has a value of 2 or higher, then the function works fine. If the value is less than 1, then the function acts as it's supposed to. The issue I'm having is any real number between 1.0 and 1.9999... If the z variable is pulling a real number that is 1.25, then the function recognizes that as a False statement, and not proceeding as I intended it to.
My question is this an error on my end, or is this how the greater than function works? The help page on the lisp states it compares real numbers and integers, so I don't think adjusting my variables to be the same type would matter; but I tried that anyway and it didn't work. Is the accuracy of real numbers to the nearest whole number, or can I adjust it's accuracy? I'm not looking for someone to write my lisp for me, but I've met a road block just before the finish line. I'd just like some clarification on this function and/or any other means to fix this issue.
I appreciate any help on the matter.
Solved! Go to Solution.