# Re: [PEDA] What's wrong with my query language program

```In fact, there is no important difference between subtraction and division. The
problem is at the equal mark "=". With low precision of floating point calculation,
the result of the track lean angle may be 45.000000001 or 44.9999999999. These values
are not equal to 45.0000000000. So some tracks have the angle of 45-degree, but the
calculating result is not 45-degree and the tracks will be failed to be queried out.
My question is where the wrong is with the following query piece:```
```
IsTrack and ((ABS(X1-X2)-ABS(Y1-Y2))  between -1 and 1)

Why it can only query out the tracks with 0 degree?

>
>Why are you using subtraction??
>surely it then matters what the absolute lengths of the track are...
>Perhaps the following would work:
>IsTrack and ((ABS(Y2 - Y1) / ABS (X2 - X1)) = 1)
>(you could also use a trig function to make it more understandable
>ie if available use (ARCTAN((ABS(Y2-Y1) / ABS(X2-X1)) = 45), the use of the
>absolute values for both X and Y directions constrains the angle to the
>upper right quadrant, ie angles between 0 and 90degrees.
>
>Bevan
>
>

>
>----- Original Message -----
>From: "Mr. Zhang Yangtian" <[EMAIL PROTECTED]>
>To: "Protel    " <[EMAIL PROTECTED]>
>Sent: Thursday, February 12, 2004 4:47 AM
>X-Scanned: By Symantec Anti-Virus Scan Engine
>Subject: [PEDA] What's wrong with my query language program
>
>
>> I had write one line of query language in ProtelDXP as the following:
>>
>> IsTrack and ((ABS(X1-X2)-ABS(Y1-Y2))=0)
>>
>>  Its target is to find out all the tracks with their lean at 45-degree or
>135-degree. After the execution of the program, some tracks are found while
>some tracks satisfied with the constrain are leaked. I guess that the reason
>is the precision of floating point number calculation. So I change it to the
>following format:
>>
>> IsTrack and ((ABS(X1-X2)-ABS(Y1-Y2))  between -1 and 1).
>>
>> But this time, strange things happen: the queried tracks are nearlly all
>the tracks with 0 degree, not 45-degree or 135-degree. Who can tell me why.
>Is it a bug of DXP?
>>
>
>.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* To post a message: mailto:[EMAIL PROTECTED]
*
* To leave this list visit:
* http://www.techservinc.com/protelusers/leave.html
*
* Contact the list manager:
* mailto:[EMAIL PROTECTED]
*
* Forum Guidelines Rules:
* http://www.techservinc.com/protelusers/forumrules.html
*
* Browse or Search previous postings:
* http://www.mail-archive.com/[EMAIL PROTECTED]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
```