Small Fish Posted June 4, 2009 Posted June 4, 2009 I am not sure why this one plays up - If Rad = Radius - deduced previously from a selected circle. Why can't I set "MyValue" when the radius is at say 7.6? Is it because I need a fudge factor or is there something else I am missing? (if (or ( = Rad 6.35) ( = Rad 7.6) );or (setq MyValue (* 2.0 rad)) );if thanks Quote
Shawndoe Posted June 4, 2009 Posted June 4, 2009 Hi, It worked for me. I'll lay money the problem is your value for Rad is not what you think it is. Have a good one. Shawndoe Quote
Small Fish Posted June 4, 2009 Author Posted June 4, 2009 Yes but Rad for example when I look at value in the watch window is 7.6 yet it does not want to set "MyValue" Perhaps its some other problem? Quote
Lee Mac Posted June 4, 2009 Posted June 4, 2009 You could use equal instead of = as with = the two expressions must be identical to return true. With equal you can specify a fuzz, say 0.0001 or something similar. Quote
Freerefill Posted June 4, 2009 Posted June 4, 2009 Probably a silly suggestion, but you might also want to consider your units. Even if a number determined via LISP has several places after the decimal point, viewing that number will be subject to the units of your drawing, and if you don't allow any more than, say, 1 digits after the decimal point to be displayed, any number that is 7.6whatever will display as 7.6. Quote
TimSpangler Posted June 4, 2009 Posted June 4, 2009 You could use equal instead of = as with = the two expressions must be identical to return true. With equal you can specify a fuzz, say 0.0001 or something similar. I was going to suggest the same thing. I prefer (equal) to (=) in most cases concerning numeric values just for the fuzz Quote
Lee Mac Posted June 4, 2009 Posted June 4, 2009 I was going to suggest the same thing. I prefer (equal) to (=) in most cases concerning numeric values just for the fuzz Great minds think alike eh Tim... Quote
Small Fish Posted June 5, 2009 Author Posted June 5, 2009 thanks guys the fuzz factor seemed to do the trick using 'equal' Quote
David Bethel Posted June 5, 2009 Posted June 5, 2009 If you need differing fuzz factors you can use something like this: Command: (setq r 2.6) 2.6 Command: (<= 2.599 r 2.6000000000001) T -David Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.