Need precision for very large numbers in qry & tbl

  • Thread starter Thread starter Mark Nigrini
  • Start date Start date
M

Mark Nigrini

I am working on a research project that does some rather
clever calculations with the first 300 Fibonacci
numbers. I have the numbers in an Excel spreadsheet and
they are accurate and formatted as text. I then import
the text into Access.
When I change the text field to Numbers in Access, the
numbers end up being rounded with zeroes after (about)
sixteen digits no matter what field size I try (including
Double).
I need the calculations to be exact for the project. The
largest number (the 300th Fibonacci number) has about 62
digits and I would need precision up to about 70 digits
because my calculations would include calculating the
cumulative sum.
Is there some formatting or other trick in Access that
will let me get exact answers for calculations using 62
digit numbers?
Thanks, Mark (Vermont)
 
Mark Nigrini said:
I am working on a research project that does some rather
clever calculations with the first 300 Fibonacci
numbers. I have the numbers in an Excel spreadsheet and
they are accurate and formatted as text. I then import
the text into Access.
When I change the text field to Numbers in Access, the
numbers end up being rounded with zeroes after (about)
sixteen digits no matter what field size I try (including
Double).
I need the calculations to be exact for the project. The
largest number (the 300th Fibonacci number) has about 62
digits and I would need precision up to about 70 digits
because my calculations would include calculating the
cumulative sum.
Is there some formatting or other trick in Access that
will let me get exact answers for calculations using 62
digit numbers?
Thanks, Mark (Vermont)

Double is an approximate data type, rounding is inevitable when using it.

The "big" precise datatypes in Access are Decimal and Currency, but I'm
afraid that neither is anything like the size you want.
 
Brian,

You are correct on the Decimal (decimal precision 28, vs 15 of Double).
Currency, though, only offers 4 (at least in A2K which I have).

Nikos
 
Mark said:
I am working on a research project that does some rather
clever calculations with the first 300 Fibonacci
numbers. I have the numbers in an Excel spreadsheet and
they are accurate and formatted as text. I then import
the text into Access.
When I change the text field to Numbers in Access, the
numbers end up being rounded with zeroes after (about)
sixteen digits no matter what field size I try (including
Double).
I need the calculations to be exact for the project. The
largest number (the 300th Fibonacci number) has about 62
digits and I would need precision up to about 70 digits
because my calculations would include calculating the
cumulative sum.
Is there some formatting or other trick in Access that
will let me get exact answers for calculations using 62
digit numbers?


You would have to store these huge values as strings. For
calculations, try to find a third party package that can
handle numbers of that magnitude.

I could hack together something that took the strings of
numbers and broke them up into small 27 digit pieces,
convert the pieces to Decimal variants, perform an addition
and convert the resulting pieces back to a single string,
but I would not want to try to create an entire math package
using that kind of technique.
 
Back
Top