1. ## comparing decimal numbers

Registered forum members do not see this ad.

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
);or

);if

thanks

2. 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

3. 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?

4. 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.

5. 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.

6. Originally Posted by Lee Mac
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

7. Originally Posted by TimSpangler
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...

8. I've heard that.......

9. thanks guys the fuzz factor seemed to do the trick using 'equal'

10. Registered forum members do not see this ad.

If you need differing fuzz factors you can use something like this:

Code:
```Command: (setq r 2.6)
2.6

Command: (<= 2.599 r 2.6000000000001)
T```
-David

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts