<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 'Use of real types can result in precision problems' in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62300#M38962</link>
    <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;  &lt;BR /&gt;
I have had code like this fail:  
&lt;PRE&gt;IF angle = 90 THEN...&lt;/PRE&gt;  &lt;BR /&gt;
...and replaced it with the following which worked:  
&lt;PRE&gt;IF angle &amp;gt; 89.99 &amp;amp; angle &amp;lt; 90.01 THEN...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
  &lt;BR /&gt;
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.&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.</description>
    <pubDate>Thu, 18 Nov 2004 00:19:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-11-18T00:19:47Z</dc:date>
    <item>
      <title>'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62296#M38958</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;When trying to edit, in AC9, an object created by AC7, I get the message on the title of this post when the 'Check Script' button is pressed. I haven't changed anything in the scripts yet.&lt;BR /&gt;
The line where the warning points to have IF statements like these: &lt;BR /&gt;
IF B=0 THEN .... &lt;BR /&gt;
IF anyparameter&amp;lt;&amp;gt;0 THEN... &lt;BR /&gt;
Despite the warnings, the object seems to work perfectly. &lt;BR /&gt;
What 'real types' is AC talking about??&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Nov 2004 19:35:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62296#M38958</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-16T19:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62297#M38959</link>
      <description>Hi Durvall,&lt;BR /&gt;
&lt;BR /&gt;
I answered this here:&lt;BR /&gt;
&lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?p=24377#24377" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... 4377#24377"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?p=24377#24377&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
AFAIK, this is only a checkscript warning/aid ... and will not affect the running of an otherwise correct script.&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Wed, 17 Nov 2004 03:32:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62297#M38959</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-11-17T03:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62298#M38960</link>
      <description>I have run into problems like this with real numbers when using calculated values in conditional statements.&lt;BR /&gt;
&lt;BR /&gt;
I have had code like this fail:&lt;BR /&gt;

&lt;PRE&gt;IF angle = 90 THEN...&lt;/PRE&gt;

...and replaced it with the following which worked:&lt;BR /&gt;

&lt;PRE&gt;IF angle &amp;gt; 89.99 &amp;amp; angle &amp;lt; 90.01 THEN...&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2004 08:34:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62298#M38960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-17T08:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62299#M38961</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;  &lt;BR /&gt;
AFAIK, this is only a checkscript warning/aid ... and will not affect the running of an otherwise correct script.  
&lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
  &lt;BR /&gt;
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...  &lt;BR /&gt;
I found out that replacing 'IF parameter=0 THEN...' by 'IF NOT(parameter) THEN...' removes the warning. But in other cases, I still didn't figure an efficient alternative.  &lt;BR /&gt;
 
&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;  &lt;BR /&gt;
I have had code like this fail:  
&lt;PRE&gt;IF angle = 90 THEN...&lt;/PRE&gt;  &lt;BR /&gt;
...and replaced it with the following which worked:  
&lt;PRE&gt;IF angle &amp;gt; 89.99 &amp;amp; angle &amp;lt; 90.01 THEN...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
  &lt;BR /&gt;
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.</description>
      <pubDate>Wed, 17 Nov 2004 14:05:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62299#M38961</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-17T14:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62300#M38962</link>
      <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;  &lt;BR /&gt;
I have had code like this fail:  
&lt;PRE&gt;IF angle = 90 THEN...&lt;/PRE&gt;  &lt;BR /&gt;
...and replaced it with the following which worked:  
&lt;PRE&gt;IF angle &amp;gt; 89.99 &amp;amp; angle &amp;lt; 90.01 THEN...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
  &lt;BR /&gt;
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.&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.</description>
      <pubDate>Thu, 18 Nov 2004 00:19:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62300#M38962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-18T00:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62301#M38963</link>
      <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;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...&lt;/BLOCKQUOTE&gt;

I agree.  There should be some preference settings for Check Script.  Want to post it to the wish list?&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 18 Nov 2004 05:02:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62301#M38963</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-11-18T05:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62302#M38964</link>
      <description>&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;&lt;PRE&gt;IF angle = 90 THEN...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

It is perhaps better to use:&lt;BR /&gt;

&lt;PRE&gt;epsilon = 0.001 
... 
IF ABS(angle-90) &amp;lt; epsilon THEN &lt;/PRE&gt;

where you can specify epsilon once in the master script, for example.&lt;BR /&gt;
&lt;BR /&gt;
Durval's
&lt;PRE&gt;IF NOT(angle-90) THEN&lt;/PRE&gt;

is 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).&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 18 Nov 2004 05:10:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62302#M38964</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-11-18T05:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62303#M38965</link>
      <description>&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;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.&lt;/BLOCKQUOTE&gt; &lt;BR /&gt;
The accuracy should suffice if value of 'angle' is directly typed by user. But if 'angle' stores a results from a formula in the script, even 1/1,000,000 could lead to 'precision problems', couldn't it? &lt;BR /&gt;
 
&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.&lt;/BLOCKQUOTE&gt; &lt;BR /&gt;
Yes, it works, I just tested. 'NOT(x)' results true if x=0, and results false if x is anything but zero (not necessarily 1).</description>
      <pubDate>Thu, 18 Nov 2004 18:47:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62303#M38965</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-18T18:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62304#M38966</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;Durval's
&lt;PRE&gt;IF NOT(angle-90) THEN&lt;/PRE&gt;
is no different than saying angle=90,...&lt;/BLOCKQUOTE&gt;

...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....</description>
      <pubDate>Thu, 18 Nov 2004 18:57:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62304#M38966</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-18T18:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62305#M38967</link>
      <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
The point I was trying to make is that the warning could be real, and I wanted to make sure that less experienced GDL programmers didn't use your 'trick' of NOT(expression) to make the message go away, when really they need the 'epsilon' code for the code to work properly.&lt;BR /&gt;
&lt;BR /&gt;
For example, in you case, if you KNOW that angle is going to 'snap' to 90, 180, 270, and 0, then your code is fine.  The value of 90 may not really be 90 exactly (binary rep), but the representation of 90 will always equal the representation of 90.  Right?&lt;BR /&gt;
&lt;BR /&gt;
But, if the angle is &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;computed&lt;E&gt;&lt;/E&gt;, then it is very possible that a value of 90.000000001 or 89.9999999999 might result (or whatever) ... in which case your test for 'equality' would fail, even though the numbers are, from a computer math point of view, really equal.&lt;BR /&gt;
&lt;BR /&gt;
As an addition to the wish for always turning the warning on or off globally, we could ask that GDL include PRAGMAS as in other languages, so that we could write something like:&lt;BR /&gt;

&lt;PRE&gt;#PRAGMA noerrorchecking
IF angle=90 THEN ...
#PRAGMA errorchecking&lt;/PRE&gt;

To turn the warning off on code that we know is fine.&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 18 Nov 2004 19:10:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62305#M38967</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-11-18T19:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62306#M38968</link>
      <description>Would using MOD(parameter)=90 work?</description>
      <pubDate>Fri, 19 Nov 2004 07:18:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62306#M38968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-19T07:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62307#M38969</link>
      <description>To clarify my previous comments here...&lt;BR /&gt;
&lt;BR /&gt;
I have often used conditional tests of angle values for a variety of purposes (for example, to get symbol texts to appear correctly - not upside down, etc.). I find that I can easily exclude conditions that extremely close to 0, 45, 90, etc. (within 1/100th of a degree) since this is never an intentional setting. &lt;BR /&gt;
&lt;BR /&gt;
I started doing this in version 6 (or 6.5?) when I found that mirroring elements would result in symbol angles of 359.9994 (or there about).&lt;BR /&gt;
&lt;BR /&gt;
It is often possible to exclude certain angle values as meaningless. For example, I have moulding and trim objects with adjustable hotspots for the miter angles. Since no trim will ever be mitered to an angle over 175° (90° being a square cut), I set it up so that the part automatically snaps to a self return as soon as this angle is exceeded.&lt;BR /&gt;
&lt;BR /&gt;
Whether you need to be concerned about accuracy to 0.0001° depends, I suppose, on the circumstances, but I can't imagine any such condition myself.</description>
      <pubDate>Fri, 19 Nov 2004 12:14:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62307#M38969</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-19T12:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62308#M38970</link>
      <description>&lt;BLOCKQUOTE&gt;HANIEL wrote:&lt;BR /&gt;Would using MOD(parameter)=90 work?&lt;/BLOCKQUOTE&gt;

I believe you mean INT(value). MOD uses the form x MOD y and returns the remaining (fractional, decimal) value after dividing x by y.&lt;BR /&gt;
&lt;BR /&gt;
The INT function will not work if the actual value is 89.99°, and a whole degree (from 90.0000 to 90.9999) is a pretty large range.</description>
      <pubDate>Fri, 19 Nov 2004 12:25:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62308#M38970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-19T12:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62309#M38971</link>
      <description>Won't it be great when macro's (as functions) work 'properly' and we can use;&lt;BR /&gt;
&lt;BR /&gt;
if MyApprox(Angle, 90, AcceptableError)=TRUE then ...&lt;BR /&gt;
&lt;BR /&gt;
Define Function "MyApprox" (variable, value, limit)&lt;BR /&gt;
if ABS(value-variable) &amp;lt;= limit then TRUE&lt;BR /&gt;
else FALSE&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="red"&gt;Balazs - where are you? &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
- Stuart</description>
      <pubDate>Fri, 19 Nov 2004 12:53:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62309#M38971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-19T12:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62310#M38972</link>
      <description>The "real types" are worse than I thought.&lt;BR /&gt;
The warning is haunting me in A LOT of IFs that used to work perfectly in AC7.&lt;BR /&gt;
I did some simple tests. It seems that any condition wich has an "=" or a "&amp;lt;&amp;gt;" sign in an IF-THEN statement makes the warning to come up.&lt;BR /&gt;
Is it possible that we can not use such a basic code as "IF something = anything" without the annoying message anymore??&lt;BR /&gt;
Please tell me I'm wrong...</description>
      <pubDate>Fri, 26 Nov 2004 20:42:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62310#M38972</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-26T20:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62311#M38973</link>
      <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;The "real types" are worse than I thought.&lt;BR /&gt;
The warning is haunting me in A LOT of IFs that used to work perfectly in AC7.&lt;BR /&gt;
I did some simple tests. It seems that any condition wich has an "=" or a "&amp;lt;&amp;gt;" sign in an IF-THEN statement makes the warning to come up.&lt;BR /&gt;
Is it possible that we can not use such a basic code as "IF something = anything" without the annoying message anymore??&lt;BR /&gt;
Please tell me I'm wrong...&lt;/BLOCKQUOTE&gt;

It should only happen if either of  "something" and "anything" is a real (floating point) number.  In fact, the warning should also occur for the &amp;lt;= and &amp;gt;= operators .... anything that includes an exact equality (or the exact inequality &amp;lt;&amp;gt;).&lt;BR /&gt;
&lt;BR /&gt;
As we discussed earlier, this should be a warning that can be turned off:  why don't you make it an official wish over at:&lt;BR /&gt;
&lt;A href="http://archicad-talk.graphisoft.com/viewforum.php?f=31" target="_blank"&gt;http://archicad-talk.graphisoft.com/viewforum.php?f=31&lt;/A&gt;&lt;BR /&gt;
so we can all vote.&lt;BR /&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Fri, 26 Nov 2004 23:37:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62311#M38973</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-11-26T23:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62312#M38974</link>
      <description>Ok, I'll write a wish/poll about this issue.&lt;BR /&gt;
But before this, let's clarify the wish a bit.&lt;BR /&gt;
Where is, in ArchiCAD 9, the equivalent to 'Options&amp;gt;Preferences&amp;gt;Imaging &amp;amp; Calculation&amp;gt;Interrupt with error messages' that was present in AC 7 and older?&lt;BR /&gt;
I understand what we want is not exactly this. We don't want the option to turn off the actual &lt;B&gt;error&lt;/B&gt; messages; just the &lt;B&gt;warning&lt;/B&gt; messages, i.e., the messages pointing to issues that don't necessarily prevent the scripts from working correctly.&lt;BR /&gt;
So, there's another wish embeded in this one: the error/warning messages should be divided in two groups: &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;critical&lt;E&gt;&lt;/E&gt; and &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;not-critical&lt;E&gt;&lt;/E&gt;, or something alike.&lt;BR /&gt;
Is that correct?</description>
      <pubDate>Sun, 28 Nov 2004 15:19:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62312#M38974</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-28T15:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62313#M38975</link>
      <description>Ok, the wish is now official:&lt;BR /&gt;
&lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=4827" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... php?t=4827"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?t=4827&lt;/LINK_TEXT&gt;&lt;/A&gt;</description>
      <pubDate>Tue, 30 Nov 2004 19:19:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62313#M38975</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-11-30T19:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62314#M38976</link>
      <description>&lt;BLOCKQUOTE&gt;Durval wrote:&lt;BR /&gt;The line where the warning points to have IF statements like these: &lt;BR /&gt;
IF B=0 THEN .... &lt;BR /&gt;
IF anyparameter&amp;lt;&amp;gt;0 THEN... &lt;BR /&gt;
Despite the warnings, the object seems to work perfectly. &lt;BR /&gt;
What 'real types' is AC talking about??&lt;/BLOCKQUOTE&gt;

This warning is really very helpful, but the way AC communicates it is not. 'Real' types means floating point numbers, i.e. numbers with a fraction part like 3.14159...&lt;BR /&gt;
&lt;BR /&gt;
If you type something like, "IF (x = 0) ..." where x is a real number, it will definitely do something undesirable in the future. Say you have a real parameter called 'x', and its value is displayed as '0'; yet it is quite possible for the expression (x = 0) to return FALSE. Why? Because 'x' is really 0.0001, but ArchiCAD will not display that level of precision. It knows the value is not zero, but displays 0 to the user. Worse still, trying to type '0' into the value still doesn't make it 0 - ArchiCAD doesn't realise that anything has changed and leaves it as 0.0001. This can be very frustrating for users who don't understand these issues.&lt;BR /&gt;
&lt;BR /&gt;
I never type expressions like "IF (x = 0) ....". I use the technique Karl described - define a level of precision at the beginning of your script and use that throughout, e.g.
&lt;PRE&gt;eps = 1e-5
IF (ABS(x) &amp;lt; eps) ...
&lt;/PRE&gt;

I think a better wish would be for errors/warnings to be displayed in something like the report window rather than displaying them one by one in a modal dialog box. Ideally you would be able to double click on any warning/error in the list and it would take you to the offending line. That way you can disregard warnings if you want to, but the reminder is always there... you never know when it might spare you a lot of grief. &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Tue, 30 Nov 2004 20:59:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62314#M38976</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2004-11-30T20:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: 'Use of real types can result in precision problems'</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62315#M38977</link>
      <description>&lt;BLOCKQUOTE&gt;StuartJames wrote:&lt;BR /&gt;Won't it be great when macro's (as functions) work 'properly' and we can use;&lt;BR /&gt;
&lt;BR /&gt;
if MyApprox(Angle, 90, AcceptableError)=TRUE then ...&lt;BR /&gt;
&lt;BR /&gt;
Define Function "MyApprox" (variable, value, limit)&lt;BR /&gt;
if ABS(value-variable) &amp;lt;= limit then TRUE&lt;BR /&gt;
else FALSE&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="red"&gt;Balazs - where are you? &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
- Stuart&lt;/BLOCKQUOTE&gt;

Stuart, i agree with you. &lt;BR /&gt;
Let's take this example about text position (old GV's names to make short).&lt;BR /&gt;
&lt;BR /&gt;
IF (W~ &amp;gt; 90 AND W~ &amp;lt;= 270) THEN ROT2 180 ELSE ROT2 0&lt;BR /&gt;
Currently, this script works, with some weaks for limt values, and i understand now, why.&lt;BR /&gt;
Thanks to all the programmers for their explanations.&lt;BR /&gt;
&lt;BR /&gt;
According to the new rules, i should write, if i understand correctly&lt;BR /&gt;
eps=0.0001&lt;BR /&gt;
IF (ABS(W~ -90) &amp;gt; eps AND ABS(W~ -270) &amp;lt;= eps) THEN ROT2 180 ELSE ROT2 0&lt;BR /&gt;
it does'nt work.&lt;BR /&gt;
&lt;BR /&gt;
If i write&lt;BR /&gt;
IF ((W~ -90) &amp;gt; eps AND (W~ -270) &amp;lt;= eps) THEN ROT2 180 ELSE ROT2 0&lt;BR /&gt;
this statement works perfectly.&lt;BR /&gt;
&lt;BR /&gt;
DEFINE STYLE "5" Arial, htex, 5, 0&lt;BR /&gt;
STYLE "5"  &lt;BR /&gt;
TEXT2 0, 0, mytext&lt;BR /&gt;
&lt;BR /&gt;
May be i need some explanations to understand better, but i have to say that this is not intuitive for non programmers.&lt;BR /&gt;
I prefer a more understandable solution, as Stuart proposed.</description>
      <pubDate>Tue, 30 Nov 2004 21:01:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Use-of-real-types-can-result-in-precision-problems/m-p/62315#M38977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-11-30T21:01:50Z</dc:date>
    </item>
  </channel>
</rss>

