The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#71733 by dhs
Sun Jun 25, 2017 4:25 pm
The release notes from DataCAD 11 state that 'Existing DCAL macros should be compatible with DataCAD 11. Due to DCAL’s limitations, existing macros still use single-precision math.' The implication seems to be that new macros compiled with DataCAD 11 onwards will use double precision.

Can anybody confirm what precision DCAL uses?

The reason for my question is that I am seeing differences between a DCAL macro and DataCAD itself with distance calculation etc. I am using mm scale (the differences would probably never be see using feet/inch/fraction type scales)

As an example, if I prompt the user to enter a distance (using getdis) in a macro and they enter 1000 (mm) and I use that distance to set the zbase, then DataCAD displays the zbase as 1000.00000762939 (which looks quite silly). If I set the zbase as 1000 in DataCAD itself the the zbase is displayed as 1000. The difference would seem to imply a difference in precision between the 2 ? Or perhaps there is some rounding of the display (but I cannot understand why the display would be rounded differently depending on how the value was set).
The same thing happens if I move an entity in the z direction using a macro and then identify it to find the Z-Min (and presumably if I move in other directions, but it is less obvious). If I move an entity in DataCAD itself then it seems to be precise, but if I move it using a macro then the distance is out by these insignificant amounts (or at least they would be insignificant if DataCAD didn't display them, but the number of decimal places displayed highlights the difference).
#71739 by dhs
Mon Jun 26, 2017 2:01 pm
Thanks Dave,

I pretty much assumed that, although the notes about 'existing macros' using single precision does seem to imply otherwise. But it is good to have it confirmed.

It is probably obvious why I was wanting to set z-base using DCAL for Delphi (as I assume that will be double precision).
#71742 by David A. Giesselman
Mon Jun 26, 2017 3:09 pm
Your assumption is correct, DCAL for Delphi is double-precision. You could even use the Extended data type (10-byte real) in your local computations. Although, any data stored (and used) by DataCAD would revert back to a Double (8-byte real).

Who is online

Users browsing this forum: No registered users and 1 guest

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.


Software for AEC Professionals Since 1984