- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tow identical programs one running on an Alpha withVMSand the other on a PC withWindows XP both are doing some calculations with real values and I am getting differences because the numbers used for the calculations are changing in the less significant digits after the decimal point for example
REAL X
X = 23.899997
If I print the value I will see 23.89999699603 on theWindows and 23.89999699328 on VMS(less significantdecimal digits) and if this value is used in several operations it is generating differences in the resultsbetween two versions for example 998.37238 in VMS against 998.3250 which is a significant difference for the kind of job I am doing.
Do you know a way to avoid having this kind of differences?
Thank you in advance
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Migrating from platform to platform it is expected to see these types of differences.
When using decimal numbers whos fractions (in binary) cannot be exactly expressed in the precision available you are to accept "round-off errors". Your request is to ask for the same "round-off error" on different processor archetectures as well as different register level execution sequences. This is not a reasonable expectation.
Also, the significant digits of the precision of used for X (real*4), which is 8 digits, cannot be attained even if the decimal fractions are expressible in binary notation.
Consider converting the REAL*4 to REAL*8 for both the VMS and PC versions of the code. Produce a set of results data on the VMS system. Compare it to the REAL*4 results data on VMS, noting any differences that you approve or disapprove of. Then produce a set of results data on the PC. Using the data available, determine what is and what is not acceptible.
Note, back when you purchased the VMS system RAM was dear, now it is a pittance. Perhaps now is a good time to migrate to REAL*8. (or to make a blend of REAL*4 and REAL*8).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll also comment that single-precision is good to six decimal digits only. You are looking at differences in the 10th digit and if this is important, you should be using double precision.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will try using /QxP option and check new results also Iwas planning to use a blend if REAL*4 and REAL*8 and see what happen
Now Ido knowthatsome differences need tobe accepted
Thank you
JCHAROD
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page