Author Topic: rounding "error" with <  (Read 1043 times)

0 Members and 1 Guest are viewing this topic.


  • Newt
  • Posts: 192
rounding "error" with <
« on: May 08, 2009, 07:22:15 PM »
I have a points list stripped from LWPOLYLINES, adj_pt.

Code: [Select]
(foreach b adj_vt
   (if (and (< (car (apply 'mapcar (cons 'min pbox)))
       (car b)
       (car (apply 'mapcar (cons 'max pbox)))
    (< (cadr (apply 'mapcar (cons 'min pbox)))
       (cadr b)
       (cadr (apply 'mapcar (cons 'max pbox)))
     (setq vip (append vip (list b)))
   ) ;_ if
) ;_ foreach b

that works nicely to detect vertexes within a rectangular selection set, but sometimes I get a point I DON'T want, one for which <= would be T but I think < should return nil.

evidently, there is rounding error in one of the points because that naughty point is sneaking past the < function, and the only thing I passed the data through was setq.

I am a bit perplexed, and although this has been hard to express, any illumination would be most welcome.

Never express yourself more clearly than you are able to think.