Doubles are truncated

Hello, we have linked our system’s main DLL (tol.dll) with CINT in order to use the C/C++ interpreter dynamically from our applications. This is a multiplatform system that works in both Windows and Linux and which comprises various executables that use this library: one of them is a simple main in console mode, another links with TCL (again in console mode), and yet another links with TCL/TK and loads a graphical environment with no console. The three of them call

G__init_cint(“cint”)

in the first line of their respective main functions.

To check the problem we are observing we execute the following C++ code of our DLL

G__setautoconsole(1);
G__exec_text(" double x = 2.1112; printf("[x=%.15lg]\n",x); ");

In both Linux and Windows XP, and for all executables, the result printed on screen is the expected result, that is, [x=2.1112]]. However, for Windows 7 only the console executables behave as expected, while the graphical executable seems to not understand the decimal and writes simply [x=2].

If however we define:

G__exec_text(" double x = 21112.0 / 10000.0; printf("[x=%.15lg]\n",x);");

we obtain [x=2.1112] in all cases.

any idea of what is going wrong?

best regards,

J.

Hi,

It possible that the microsoft compiler/library does no understand the ‘lg’ printf flag. TryG__exec_text(" double x = 21112.0 / 10000.0; printf(\"[x=%.15g]\n\",x);");

Cheers,
Philippe.