Get Your Numbers Right


 2,147,483,648 SD Edition
Pure mathematics in Excel without limits


A 2,147,483,648 SD Edition of xlPrecision is available for use in your programming code. Yes, that's over TWO BILLION significant digits. Of course, you can also use any other edition of xlPrecision in your programming code.

For Pure Mathematics

The 2,147,483,648 SD Edition was created at the request of a number theorist in Germany, who needed at least 110,000 significant digits, and possibly more, for his Number Theory project. Number Theory is a branch of Pure Mathematics. Although most customers of this edition use it for number theory, it is also in use by at least one customer for Combinatorics, another branch of pure mathematics.

Some Functions Limited to 32,767 SD

Some xlPrecision functions are currently limited to 32,767 significant digits even in the 2,147,483,648 SD Edition, because they or another function they depend on are stored as 32,767-digit constants in the DLL file. A 2,147,483,648-digit constant would make the DLL file extremely large.

To work around this limitation, if there is demand for it, I could add an option to get the constants from text files, which you could download and truncate to the desired length; let me know if you'd like that.

The affected functions are:

Of course, xlPrecision functions that call pi, e, exp, log, or ln are affected too. The affected functions are:

For Programmers

This edition is intended for use in your programming code, such as VBA. Use caution if using the 2,147,483,648 SD edition within an Excel worksheet, because Excel worksheets cannot accept more than 32,767 characters per cell.

Why Exactly 2,147,483,648 Significant Digits?

xlPrecision numbers are stored and manipulated internally as text strings, and xlPrecision's programming environment does not permit text strings longer than 2^31 characters long. 2^31 (two to the thirty-first power) is 2,147,483,648. It may be possible to make an edition that is limited only by memory by using arrays of those text strings, but it would take some work to get all the math procedures to work with those arrays, and I don't think there is any need to exceed that limit.


Word VBA

If using the 2,147,483,648 edition in Word VBA, note that Word VBA's TypeText method is limited to 64k, which on unicode versions of Word (such as Word 2003) is 32,767 characte
rs. If you exceed that, it starts over; for example, if you give it 32,769 characters, it returns only the first 2 characters (32,769 - 32,767 = 2).

To work around that limitation (bug?), use Word VBA's InsertBefore method instead of TypeText. Or, if InsertBefore doesn't suit your needs, another approach would be to loop through the text 32,767 characters at a time, using Mid to get a 32,767-character chunk, and doing a TypeText on that chunk, each time through the loop.


The 2,147,483,648 SD Edition is available as a Free Edition, an Express Edition, a Research Edition, and a Site License:






xlPrecision Home Page
PrecisionCalc Home Page