cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

When I use the check script, I get this error.

LeeJaeYoung
Advisor

LeeJaeYoung_0-1665337746789.png

IF WALL_SKINS_PARAMS[i][6] = 3 THEN

 

• [6] core status
core status: 0 - not part, 1 - part, 3 - last core skin.

 

AC25 5010 / AC26 4019 on window 11
1 ACCEPTED SOLUTION
6 REPLIES 6

Solution
DGSketcher
Champion

This is generated when using = to compare REAL values. It works with INTEGERS but GDL is prone to false results for Real values due to precision.

 

The usual workaround in your coding is:

 

EPS = 0.0001 !or some other small value to suit your object

IF ABS (WALL_SKINS_PARAMS[i][6] - 3.00) < eps THEN...

 

this way if the divergence between values is less the EPS then the result will be TRUE, and any value greater than 3.00 will be FALSE

Apple iMac macOS Monterey / AC26UKI (most recent builds)

So is this real value?
I understand it as an integer....

 

Is INT(WALL_SKINS_PARAMS[i][6]) = 3 ok?

AC25 5010 / AC26 4019 on window 11

You would expect the core to be an integer (0, 1 or 3), but because WALL_SKINS_PARAMS can also tell you the skin thickness, the entire parameter is probably treated as a real number (just my guess).

So the core value (although it may be exactly '3') is also treated as a real number, which means it could have a decimal precision.

 

You are then trying to compare something that may have a decimal precision with something that does not - hence the message to say "Use of real types can result in precision problems".

 

In this case it is just a warning and can probably be ignored - you will only see it when checking the script.

 

Or it is a case of scripting as DGSketcher suggested to allow for a small decimal range (error).

 

Barry.


One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

thank you so much

AC25 5010 / AC26 4019 on window 11

In this case, when the stored value is surely an integer, round_int might be easier to read.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

@Peter Baksa Thank you for your guidance. I had forgotten that option. Might need to review some of my coding... 👍

Apple iMac macOS Monterey / AC26UKI (most recent builds)

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!