2004-11-16 08:35 PM
2004-11-17 04:32 AM
2004-11-17 09:34 AM
IF angle = 90 THEN......and replaced it with the following which worked:
IF angle > 89.99 & angle < 90.01 THEN...
2004-11-17 03:05 PM
Karl wrote:
AFAIK, this is only a checkscript warning/aid ... and will not affect the running of an otherwise correct script.
Matthew wrote:
I have had code like this fail:IF angle = 90 THEN...
...and replaced it with the following which worked:IF angle > 89.99 & angle < 90.01 THEN...
2004-11-18 01:19 AM
Durval wrote:If you need tighter precision use 89.9999. I can't believe that a accuracy to 1/10,000 of a degree can possibly matter to you.Matthew wrote:
I have had code like this fail:IF angle = 90 THEN...
...and replaced it with the following which worked:IF angle > 89.99 & angle < 90.01 THEN...
What if your angle is 89.991? IMHO, this is actually the one that 'can result in precision problems'... Maybe 'IF NOT(angle-90) THEN...' is a better option. I will test it now.
2004-11-18 06:02 AM
Durval wrote:I agree. There should be some preference settings for Check Script. Want to post it to the wish list?
In the referred script, I have tens of IFs triggering that warning. So, I wouldn't call it an 'aid', because it is very annoying having to click again and again the 'continue' button every time I need to check for actual errors. I must find a way to get reed of the 'aid', to preserve my finger and my mental health...
2004-11-18 06:10 AM
Matthew wrote:It is perhaps better to use:IF angle = 90 THEN...
epsilon = 0.001 ... IF ABS(angle-90) < epsilon THENwhere you can specify epsilon once in the master script, for example.
IF NOT(angle-90) THENis no different than saying angle=90, and so would still have potential representational/precision errors and fail (unless the NOT operator does more than zero/non-zero testing and tests for an epsilon factor).
2004-11-18 07:47 PM
Matthew wrote:
If you need tighter precision use 89.9999. I can't believe that a accuracy to 1/10,000 of a degree can possibly matter to you.
Matthew wrote:
The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.
2004-11-18 07:57 PM
Karl wrote:...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....
Durval'sIF NOT(angle-90) THENis no different than saying angle=90,...
2004-11-18 08:10 PM
Durval wrote:It sort of makes sense to not trigger the warning since the result is to be used for simply a zero/non-zero test ... sort of a boolean conversion. Still subject to problems, but I imagine that's their logic.
...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....
#PRAGMA noerrorchecking IF angle=90 THEN ... #PRAGMA errorcheckingTo turn the warning off on code that we know is fine.