What is the recommended method to do arithmetic that requires greater
precision than is available with the Long type? I can write my own routines
using strings to represent very long numbers, or arrays of Longs meant to be
concatenated, but if there is a method already worked out by somebody else
that would make it easier. (This is not for a business application but for
Mathematical problem solving.)
It depends on what kinds of operations you need to do. For example,
see:
http://groups.google.com/group/comp.databases.ms-access/msg/b36b2f535e1a8ac4
I suspect that it is possible to do quite extraordinary mathematical
operations on numbers stored as strings, but I have not had enough
need for such precision to flesh out the techniques for such a
mathematical framework. I wrote some input routines that used strings
for numbers back when I did some Turbo Pascal programming, but they
were not designed with the goal of increasing the precision of
operations. The last time I had to deal with precision greater than
Double on a regular basis was in one of my Numerical Analysis
classes. The IMSL library might have something, but it only supports
Fortran, Java, C, C#.NET and Python according to Wikipedia. VBA
certainly has the capability of extending the precision of operations
on numbers represented as strings, especially when enhanced with some
advanced math to provide support for more complicated operations, but
I do not currently have such a set of VBA functions ready to go. If
you only have to deal with integers, I have seen data types rolled
with two Longs that specify the upper Long and the lower Long, but
that would be limited to operations where the effect on a binomial
expression limited to the realm of Integers simplifies.
James A. Fortune
(e-mail address removed)