Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

ERROR MESSAGE IN SCRIPTING

Anonymous
Not applicable
I HAVE BEEN GETTING A COMMON ERROR MESSAGE WHEN CHECKING SCRIPT

SEEMS TO BE A THE POINT OF USING A IF THEN ELSE STATEMENT

' USE OF REAL TYPES CAN RESULT IN PRECISION PROBLEMS AT LINE XX OF FILE XXXXXX'

I THINK I HAVE ONLY HAD THIS MESSAGE SINCE MOVING TO AC 9
2 REPLIES 2
Anonymous
Not applicable
This annoying message started appearing somewhere between 8.0 and 8.1 as I recall. It is alerting you to a potential problem. The trouble is that it usually is not an actual problem.

The warning is generated when you use a conditional statement (IF, WHILE, REPEAT) with a precise value for a real number as the condition. Such as:

IF x = 0 THEN...

rather than:

IF x > -0.0001 AND x < 0.0001...

As I understand it the actual problems arise when "x" is the result of a calculation, since rounding errors can produce very small inaccuracies which will prevent it from exactly equalling the desired value even though it should.

The trouble is that I (and many others I am sure) often use a named parameter as the condition with a VALUES statement to limit it to the precise values used in the conditional statements. This precludes any actual errors but still generates the pesky warning.

BTW, turn off your caps lock. It's not polite to shout 😉
Frank Beister
Moderator
Have a look to this thread:
Use of real types
and this:
Use of real types can result in precision problems
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm