[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Numerics Problem with numbers > 2 ** 31.
Clipper Version 1.03 dtd 09/15/90.
Problem Statement
Certain large numbers, entered as variables, return unexpected
values. Examples:
Assignment ? nVar
nVar := 4503599627436033 => 4503599627436033
nVar := 4503599627436032 => 4503599627436032
nVar := 4503599627436031 => 65535
nVar := 4503599627403264 => 35868
nVar := 4503599627403263 => 32767
nVar := 4503599627370498 => 2
nVar := 4503599627370497 => 1
nVar := 4503599627370496 => 0 // 2 ** 54
nVar := 4503599627370495 => -1
nVar := 4503599627370494 => -2
nVar := 4503599627337729 => -32767
nVar := 4503599627337728 => 4503599627337728
nVar := 4503599627337727 => 4503599627337727
Cause
Unknown.
Work Around(s)
Append '.0' to the variable at assignment; e.g.,
nVar := 4503599627370496.0 => 4503599627370496.0
Notes
The above example 'ranges' about 2 ** 54. Similar, but not identical,
results will occur when nVar > 2 ** 31. Attempts to assign nVar as
ROUND(nNumber,nPlaces) or nNumber * 1.0 failed to cure the problem;
however, if nVar is created as a result of say 2 ** 32, the assignment
appears to be correct.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson