Hello everyone,
I'd like to return an ads_real (double) value to Lisp using acedRetReal(), but as a result the value is either rounded or truncated.
Here's the code :
int lisp_testReal(void)
{
ads_real n = 4.59950316371;
acedRetReal(n);
return 0;
}
After calling the function in AutoCAD, this is what I get : 4.5995. Similar behaviour if I set n to be equal to 1237.992458, the function will return 1237.99.
Is there any way to maintain the exact same number, without any modifications ? Thank you in advance.
I'm working on ObjectARX 2012 for AutoCAD 2012 x64 using MS Visual Studio 2008.
Kindly,
Siwar_M
Solved! Go to Solution.
Solved by artc2. Go to Solution.
We don't round off real numbers internally - they are maintained as doubles.
How are you determining that the number has been rounded off? If you are simply looking at the value on the Acad command line, then that roundoff is from the display, not from the actual variable being rounded off.
You were right, the value remained unchanged, it was just the command line that was displaying an approximation.
Thank you for the help.
Siwar_M