![]() |
HOWTO: PX_Double with greater precision |
Post Reply
|
| Author | |
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Topic: HOWTO: PX_Double with greater precisionPosted: 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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |