Is DCAL single or double precision ?
Posted: Sun Jun 25, 2017 4:25 pm
Hi,
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).
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).