A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Disclaimer: I am not familiar with Excel-DNA, a third-party application, I believe. And I have not been able to find documentation about its Decimal type. So I cannot comment on its internal representation and limitations.
It was during debugging that I found that a variable possessing the number, appearing as 53232.5630803013 on Excel was actually 53232.563080301348 i.e. 12 digit fraction (Additional 2 digits).
[....]
Then recalled the fact of the Excel not possessing more than 15 digits. Any reasonable justification of not generating core random figures within the said limits of 15 Digits or at least being rounded-off by default???
Excel "processing" (calculation) is not limited 15 significant digits (except as noted below).
And Excel does not "store" only 15 signficant digits, contrary to what even MSFT documentation says.
But it is true that when converting numeric text, including what we enter manually, Excel interprets only the first 15 significant digits, ignoring any digits to the right. So Excel effective truncates, not rounds, data entry after 15 significant digits.
And it is true that Excel formats only up to 15 significant digits, rounding any digits to the right.
OTOH, Excel formats up to 17 significant digits when writing to XML files, including the worksheet files in "xlsx" and "xlsm" file, which are actually zipped archives.
And Excel interprets up to 17 significant digits when reading numeric text from XML files.
(Also, apparently the 17-significant-digit limits apply to interfacing between some applications, e.g. Access, AFAIK based on answering user's questions.)
FYI, Excel VBA also interprets 17 significant digits (and even more) when converting numeric text. However, like Excel, VBA formats only up to 15 significant digits.
However, even though 17 significant digits is necessary and sufficient to convert between decimal and binary representations with no loss of precision, according to the IEEE 754 standard, the 17-significant-digit value is still just an estimate of the exact value.
For example, what appears to be 53232.563080301348 is actually exactly 53232.563080301348236389458179473876953125.
Like most applications, Excel stores decimal numbers as the sum of 53 consecutive powers of 2, in accordance with the 64-bit binary floating-point standard (IEEE 754).
Since most decimal fractions cannot be represented exactly as the sum of 53 (and even more) consecutive powers of 2, their internal binary representation is an approximation.
(That also applies to most integers that exceed 2^53 (9007199254740992, which Excel displays 9007199254740990.)
Moreover, the binary approximation of a particular decimal fraction might vary depending on the magnitude of the number because some of the 53 consecutive powers of 2 are used to represent the integer part, leaving fewer powers of two and a less precise sum for the decimal fraction.
That is why, for example, 10.01 - 10 = 0.01 returns FALSE (!). The following shows the exact decimal representation of the binary approximation of the values on the left.
10.01 10.0099999999999997868371792719699442386627197265625
10.01 - 10 0.0099999999999997868371792719699442386627197265625
0.01 0.01000000000000000020816681711721685132943093776702880859375
In that case, the difference between 10.01 - 10 and 0.01 is apparent if we format the results with 17 decimal places.
But it is not always apparent, due to the Excel formatting limitation. For example:
A1: 33.03000000000000000 33.030000000000001136868377216160297393798828125
A2: 11.83000000000000000 11.8300000000000000710542735760100185871124267578125
A3=A1-A2: 21.20000000000000000 21.2000000000000028421709430404007434844970703125
A4: 21.20000000000000000 21.199999999999999289457264239899814128875732421875
In that case, A3=A4 returns TRUE because for the comparison operators ("=", "<>", etc), Excel rounds each operand to 15 significant digits internally just for the purpose of the comparison.
But ISNUMBER(MATCH(A3,A4,0)) returns FALSE because their binary values are different. Also, A3-A4=0 returns FALSE for a similar reason.
Such inconsistencies are due to dubious arbitrary design decisions that are specific to Excel (and work-alike apps). They are not part of the IEEE 754 standard. The dubious Excel behaviors were introduced in Excel 97 (circa 1997) in a half-baked attempt to hide some 64BFP arithmetic anomalies.
As for "any reasonable justification" for choosing 64BFP and for limiting input and formatting to 15 significant digits, the explanation is historical.