On May 27, 11:00 pm, jaip...@gmail.com wrote:
> i just thought that 18 digits should be allowed.
> However, as you have correctly specified, I also
> checked in help for limits and got the same answer
> as posted by you. Thanks again!
You're welcome. In your defense, I did find a Microsoft web page [1]
that claims that a VB type Double "can hold as many as 18 significant
digits".
That is just plain wrong. It can represent "as many as" 1074
significant digits in __some__ cases (namely, just one: the most
fractional digits with no non-fractional non-zero digits). But VB
Double uses the same internal representation as an Excel number. The
largest integer that is not a power of 2 and that can be represented
exactly is 2^53 - 1, a 16-digit number.
(But Excel will display only the first 15 digits.)
Endnotes:
[1] http://msdn.microsoft.com/en-us/library/5c53yzyb.aspx
joeu2004 - 28 May 2008 09:34 GMT
Errata....
On May 27, 11:59 pm, I wrote:
> The largest integer that is not a power of 2 and
> that can be represented exactly is 2^53 - 1, a
> 16-digit number.
Obviously I misspoke, having just demonstrated how to represent an 18-
digit integer. The largest integer that can be presented is a 309-
digit number [1]. But these are special cases.
[1] =2*(2^1023 - 2^970)
Howard Kaikow - 28 May 2008 09:44 GMT
For example, see the book 'The Definitive Duide to How computers Do Math",
ISBN 0-471-73278-8.
And see MSFT KB article 42980.
The number of significant digits is limited by the hardware for the Double
type
Excel, as with most ap0plications, just uses the data types provided by the
underlying programming language, in this case, I expect largely C++.