Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - HOWTO: PX_Double with greater precision
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: PX_Double with greater precision

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1210
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: PX_Double with greater precision
    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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1210
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.