Print Page | Close Window

HOWTO: PX_Double with greater precision

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9238
Printed Date: 14 November 2025 at 8:14am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: PX_Double with greater precision
Posted By: mgampi
Subject: HOWTO: PX_Double with greater precision
Date Posted: 07 January 2008 at 5:57am
Hi;
I'm using PX_Double to store/retrieve measured data to/from XML files. As I see in source code of XTPropExchange.cpp the conversion to/from double uses the %g format specifier. Normally this should result in a double string to represent the value 'as compact as possible'. But in my case this leads to unwantes results.
E.g. if I store a -DBL_MAX (which is defined as -1.7976931348623158e+308) the result string is -1.79769e+308. This can't no longer be compared by using DBL_EPSILON (defined as 2.2204460492503131e-016).
So my questions are:
a) How can I increase the precision of double values for storing/retrieving to/from XML files when using the core XT toolkit?
or
b) How can I write my own PX_xxxx exchange functions to not touch the source of the current toolkit (11.2.2)?


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: Oleg
Date Posted: 08 January 2008 at 1:53am
Hi,
 
As workaround you can manually convert to/from string and store PX_String.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mgampi
Date Posted: 08 January 2008 at 3:37am
Hi Oleg;
Sometimes the obvious can't be seen ...
Thanks for your help to direct me to the simplest solution!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net