topic Re: 'Use of real types can result in precision problems' in Design forum
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62314#M31507
<BLOCKQUOTE>Durval wrote:<BR />The line where the warning points to have IF statements like these: <BR />
IF B=0 THEN .... <BR />
IF anyparameter<>0 THEN... <BR />
Despite the warnings, the object seems to work perfectly. <BR />
What 'real types' is AC talking about??</BLOCKQUOTE>
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...<BR />
<BR />
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.<BR />
<BR />
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.
<PRE>eps = 1e-5
IF (ABS(x) < eps) ...
</PRE>
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. <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" />Tue, 30 Nov 2004 20:59:30 GMTRalph Wessel2004-11-30T20:59:30Z'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62296#M31489
<DIV class="actalk-migrated-content"><T>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.<BR />
The line where the warning points to have IF statements like these: <BR />
IF B=0 THEN .... <BR />
IF anyparameter<>0 THEN... <BR />
Despite the warnings, the object seems to work perfectly. <BR />
What 'real types' is AC talking about??</T></DIV>Tue, 16 Nov 2004 19:35:48 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62296#M31489Durval2004-11-16T19:35:48ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62297#M31490
Hi Durvall,<BR />
<BR />
I answered this here:<BR />
<A href="http://archicad-talk.graphisoft.com/viewtopic.php?p=24377#24377" target="_blank"><LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... 4377#24377">http://archicad-talk.graphisoft.com/viewtopic.php?p=24377#24377</LINK_TEXT></A><BR />
<BR />
AFAIK, this is only a checkscript warning/aid ... and will not affect the running of an otherwise correct script.<BR />
<BR />
KarlWed, 17 Nov 2004 03:32:42 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62297#M31490Karl Ottenstein2004-11-17T03:32:42ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62298#M31491
I have run into problems like this with real numbers when using calculated values in conditional statements.<BR />
<BR />
I have had code like this fail:<BR />
<PRE>IF angle = 90 THEN...</PRE>
...and replaced it with the following which worked:<BR />
<PRE>IF angle > 89.99 & angle < 90.01 THEN...</PRE>Wed, 17 Nov 2004 08:34:19 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62298#M31491Matthew Lohden2004-11-17T08:34:19ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62299#M31492
<BLOCKQUOTE>Karl wrote:<BR /> <BR />
AFAIK, this is only a checkscript warning/aid ... and will not affect the running of an otherwise correct script.
</BLOCKQUOTE> <BR />
<BR />
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... <BR />
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. <BR />
<BLOCKQUOTE>Matthew wrote:<BR /> <BR />
I have had code like this fail:
<PRE>IF angle = 90 THEN...</PRE> <BR />
...and replaced it with the following which worked:
<PRE>IF angle > 89.99 & angle < 90.01 THEN...</PRE></BLOCKQUOTE> <BR />
<BR />
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.Wed, 17 Nov 2004 14:05:50 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62299#M31492Durval2004-11-17T14:05:50ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62300#M31493
<BLOCKQUOTE>Durval wrote:<BR /><BLOCKQUOTE>Matthew wrote:<BR /> <BR />
I have had code like this fail:
<PRE>IF angle = 90 THEN...</PRE> <BR />
...and replaced it with the following which worked:
<PRE>IF angle > 89.99 & angle < 90.01 THEN...</PRE></BLOCKQUOTE> <BR />
<BR />
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.</BLOCKQUOTE>
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.<BR />
<BR />
The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.Thu, 18 Nov 2004 00:19:47 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62300#M31493Matthew Lohden2004-11-18T00:19:47ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62301#M31494
<BLOCKQUOTE>Durval wrote:<BR />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...</BLOCKQUOTE>
I agree. There should be some preference settings for Check Script. Want to post it to the wish list?<BR />
<BR />
KarlThu, 18 Nov 2004 05:02:29 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62301#M31494Karl Ottenstein2004-11-18T05:02:29ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62302#M31495
<BLOCKQUOTE>Matthew wrote:<BR /><PRE>IF angle = 90 THEN...</PRE></BLOCKQUOTE>
It is perhaps better to use:<BR />
<PRE>epsilon = 0.001
...
IF ABS(angle-90) < epsilon THEN </PRE>
where you can specify epsilon once in the master script, for example.<BR />
<BR />
Durval's
<PRE>IF NOT(angle-90) THEN</PRE>
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).<BR />
<BR />
KarlThu, 18 Nov 2004 05:10:57 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62302#M31495Karl Ottenstein2004-11-18T05:10:57ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62303#M31496
<BLOCKQUOTE>Matthew wrote:<BR />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.</BLOCKQUOTE> <BR />
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? <BR />
<BLOCKQUOTE>Matthew wrote:<BR />The NOT() function may only work with boolean (true/false, checkbox) parameters. I'd be curious to know if it works though.</BLOCKQUOTE> <BR />
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).Thu, 18 Nov 2004 18:47:47 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62303#M31496Durval2004-11-18T18:47:47ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62304#M31497
<BLOCKQUOTE>Karl wrote:<BR />Durval's
<PRE>IF NOT(angle-90) THEN</PRE>
is no different than saying angle=90,...</BLOCKQUOTE>
...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....Thu, 18 Nov 2004 18:57:58 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62304#M31497Durval2004-11-18T18:57:58ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62305#M31498
<BLOCKQUOTE>Durval wrote:<BR />...but NOT(angle-90) doesn't trigger the precision warning, while angle=90 does, god knows why....</BLOCKQUOTE>
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.<BR />
<BR />
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.<BR />
<BR />
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?<BR />
<BR />
But, if the angle is <I></I><S><I><I></I></I></S>computed<E></E>, 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.<BR />
<BR />
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:<BR />
<PRE>#PRAGMA noerrorchecking
IF angle=90 THEN ...
#PRAGMA errorchecking</PRE>
To turn the warning off on code that we know is fine.<BR />
<BR />
KarlThu, 18 Nov 2004 19:10:16 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62305#M31498Karl Ottenstein2004-11-18T19:10:16ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62306#M31499
Would using MOD(parameter)=90 work?Fri, 19 Nov 2004 07:18:58 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62306#M31499HANIEL2004-11-19T07:18:58ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62307#M31500
To clarify my previous comments here...<BR />
<BR />
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. <BR />
<BR />
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).<BR />
<BR />
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.<BR />
<BR />
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.Fri, 19 Nov 2004 12:14:49 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62307#M31500Matthew Lohden2004-11-19T12:14:49ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62308#M31501
<BLOCKQUOTE>HANIEL wrote:<BR />Would using MOD(parameter)=90 work?</BLOCKQUOTE>
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.<BR />
<BR />
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.Fri, 19 Nov 2004 12:25:15 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62308#M31501Matthew Lohden2004-11-19T12:25:15ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62309#M31502
Won't it be great when macro's (as functions) work 'properly' and we can use;<BR />
<BR />
if MyApprox(Angle, 90, AcceptableError)=TRUE then ...<BR />
<BR />
Define Function "MyApprox" (variable, value, limit)<BR />
if ABS(value-variable) <= limit then TRUE<BR />
else FALSE<BR />
<BR />
<FONT color="red">Balazs - where are you? <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /></FONT><BR />
<BR />
- StuartFri, 19 Nov 2004 12:53:47 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62309#M31502StuartJames2004-11-19T12:53:47ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62310#M31503
The "real types" are worse than I thought.<BR />
The warning is haunting me in A LOT of IFs that used to work perfectly in AC7.<BR />
I did some simple tests. It seems that any condition wich has an "=" or a "<>" sign in an IF-THEN statement makes the warning to come up.<BR />
Is it possible that we can not use such a basic code as "IF something = anything" without the annoying message anymore??<BR />
Please tell me I'm wrong...Fri, 26 Nov 2004 20:42:53 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62310#M31503Durval2004-11-26T20:42:53ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62311#M31504
<BLOCKQUOTE>Durval wrote:<BR />The "real types" are worse than I thought.<BR />
The warning is haunting me in A LOT of IFs that used to work perfectly in AC7.<BR />
I did some simple tests. It seems that any condition wich has an "=" or a "<>" sign in an IF-THEN statement makes the warning to come up.<BR />
Is it possible that we can not use such a basic code as "IF something = anything" without the annoying message anymore??<BR />
Please tell me I'm wrong...</BLOCKQUOTE>
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 <= and >= operators .... anything that includes an exact equality (or the exact inequality <>).<BR />
<BR />
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:<BR />
<A href="http://archicad-talk.graphisoft.com/viewforum.php?f=31" target="_blank">http://archicad-talk.graphisoft.com/viewforum.php?f=31</A><BR />
so we can all vote.<BR />
<IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /> <BR />
<BR />
KarlFri, 26 Nov 2004 23:37:32 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62311#M31504Karl Ottenstein2004-11-26T23:37:32ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62312#M31505
Ok, I'll write a wish/poll about this issue.<BR />
But before this, let's clarify the wish a bit.<BR />
Where is, in ArchiCAD 9, the equivalent to 'Options>Preferences>Imaging & Calculation>Interrupt with error messages' that was present in AC 7 and older?<BR />
I understand what we want is not exactly this. We don't want the option to turn off the actual <B>error</B> messages; just the <B>warning</B> messages, i.e., the messages pointing to issues that don't necessarily prevent the scripts from working correctly.<BR />
So, there's another wish embeded in this one: the error/warning messages should be divided in two groups: <I></I><S><I><I></I></I></S>critical<E></E> and <I></I><S><I><I></I></I></S>not-critical<E></E>, or something alike.<BR />
Is that correct?Sun, 28 Nov 2004 15:19:57 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62312#M31505Durval2004-11-28T15:19:57ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62313#M31506
Ok, the wish is now official:<BR />
<A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=4827" target="_blank"><LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... php?t=4827">http://archicad-talk.graphisoft.com/viewtopic.php?t=4827</LINK_TEXT></A>Tue, 30 Nov 2004 19:19:11 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62313#M31506Durval2004-11-30T19:19:11ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62314#M31507
<BLOCKQUOTE>Durval wrote:<BR />The line where the warning points to have IF statements like these: <BR />
IF B=0 THEN .... <BR />
IF anyparameter<>0 THEN... <BR />
Despite the warnings, the object seems to work perfectly. <BR />
What 'real types' is AC talking about??</BLOCKQUOTE>
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...<BR />
<BR />
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.<BR />
<BR />
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.
<PRE>eps = 1e-5
IF (ABS(x) < eps) ...
</PRE>
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. <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" />Tue, 30 Nov 2004 20:59:30 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62314#M31507Ralph Wessel2004-11-30T20:59:30ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62315#M31508
<BLOCKQUOTE>StuartJames wrote:<BR />Won't it be great when macro's (as functions) work 'properly' and we can use;<BR />
<BR />
if MyApprox(Angle, 90, AcceptableError)=TRUE then ...<BR />
<BR />
Define Function "MyApprox" (variable, value, limit)<BR />
if ABS(value-variable) <= limit then TRUE<BR />
else FALSE<BR />
<BR />
<FONT color="red">Balazs - where are you? <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /></FONT><BR />
<BR />
- Stuart</BLOCKQUOTE>
Stuart, i agree with you. <BR />
Let's take this example about text position (old GV's names to make short).<BR />
<BR />
IF (W~ > 90 AND W~ <= 270) THEN ROT2 180 ELSE ROT2 0<BR />
Currently, this script works, with some weaks for limt values, and i understand now, why.<BR />
Thanks to all the programmers for their explanations.<BR />
<BR />
According to the new rules, i should write, if i understand correctly<BR />
eps=0.0001<BR />
IF (ABS(W~ -90) > eps AND ABS(W~ -270) <= eps) THEN ROT2 180 ELSE ROT2 0<BR />
it does'nt work.<BR />
<BR />
If i write<BR />
IF ((W~ -90) > eps AND (W~ -270) <= eps) THEN ROT2 180 ELSE ROT2 0<BR />
this statement works perfectly.<BR />
<BR />
DEFINE STYLE "5" Arial, htex, 5, 0<BR />
STYLE "5" <BR />
TEXT2 0, 0, mytext<BR />
<BR />
May be i need some explanations to understand better, but i have to say that this is not intuitive for non programmers.<BR />
I prefer a more understandable solution, as Stuart proposed.Tue, 30 Nov 2004 21:01:50 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62315#M31508Olivier Dentan2004-11-30T21:01:50ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62316#M31509
<BLOCKQUOTE>Olivier wrote:<BR />Let's take this example about text position (old GV's names to make short).<BR />
<BR />
IF (W~ > 90 AND W~ <= 270) THEN ROT2 180 ELSE ROT2 0<BR />
Currently, this script works, with some weaks for limt values, and i understand now, why.<BR />
Thanks to all the programmers for their explanations.<BR />
<BR />
According to the new rules, i should write, if i understand correctly<BR />
eps=0.0001<BR />
IF (ABS(W~ -90) > eps AND ABS(W~ -270) <= eps) THEN ROT2 180 ELSE ROT2 0<BR />
it does'nt work.<BR />
<BR />
If i write<BR />
IF ((W~ -90) > eps AND (W~ -270) <= eps) THEN ROT2 180 ELSE ROT2 0<BR />
this statement works perfectly.</BLOCKQUOTE>
None of your examples would trigger the warning.<BR />
By the way, Karl, '>='s and '<='s also do not trigger them.Wed, 01 Dec 2004 21:14:21 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62316#M31509Durval2004-12-01T21:14:21ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62317#M31510
It seems with a recent (2045?) update, actual precision problems have arisen where there were harmless warnings before.<BR />
<BR />
I had several windows suddenly start failing to generate with 'incompatible types of expression' errors in the report. I opened them to check for errors, and the only errors were 'UORTCRIPP's.<BR />
<BR />
I fixed them and the windows were fine. I have been selectively ignoring those warnings, but I'm stopping as of now.Thu, 14 Jul 2005 16:20:56 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62317#M31510James Murray2005-07-14T16:20:56ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62318#M31511
<BLOCKQUOTE>Durval wrote:<BR /><BLOCKQUOTE>Olivier wrote:<BR />Let's take this example about text position (old GV's names to make short).</BLOCKQUOTE></BLOCKQUOTE>
Hi Durval,<BR />
<BR />
You force me to work on the national day, here, what a pity. <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /> <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /> <IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /> <BR />
Well, before a "non sleeping night", if i can clarify some points.<BR />
<BR />
Thanks to the help of many contributors on this forum, and specially Oleg's help, i solved most of these problems.<BR />
I must admit that for ">= & <=" equalities, sometime i still get some weird results.<BR />
With the quoted example, sometime i can't get correct results (for limit values), anything i try. No more with GS examples. <BR />
I don't have the truth, so, for such particular situations, i add a parameter allowing the user to correct this manually.Thu, 14 Jul 2005 19:38:31 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62318#M31511Olivier Dentan2005-07-14T19:38:31ZRe: 'Use of real types can result in precision problems'
https://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62319#M31512
I can't believe this is still an issue 14 years later.<BR />
Any way to turn off this particular error message yet?Thu, 08 Nov 2018 16:23:31 GMThttps://community.graphisoft.com/t5/Design-forum/Use-of-real-types-can-result-in-precision-problems/m-p/62319#M31512JGoode2018-11-08T16:23:31Z