Author Topic: Matching an insertion point returned by lisp  (Read 1248 times)

0 Members and 1 Guest are viewing this topic.

TimBlanch

  • Guest
Matching an insertion point returned by lisp
« on: February 27, 2012, 04:48:03 PM »
I have some blocks that have the insertion point of another block as an attribute that were populated with a my routine using BlockReference.Position.X + "," + BlockReference.Position.Y
It looks like this: 37783577.0223232,193175979.810159

There is a routine that we are using written in lisp that is trying to see if these points match and they don't of course because the routine I have written in .Net is rounded off earlier.
The lisp returns this: 3.778357702232322E+007,1.931759798101591E+008

Does anyone know a way for me to increase the number of decimal places my .Net routine returns?  and I'm not sure about the E notation being a problem yet.

Thanks,
Tim

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Matching an insertion point returned by lisp
« Reply #1 on: February 28, 2012, 01:17:02 AM »
Hi,

As far as I know, LISP and .NET real numbers should have the same accuracy, both use double precision numbers.

When comparing real numbers or points, you may use a tolerance:

Code - Lisp: [Select]
  1. (equal p1 p2 1e-9)

Code - C#: [Select]
  1. p1.IsEqualTo(p2, new Tolerance (1e-9, 1e-9));
Speaking English as a French Frog