RE: avoid scientific notation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



ONLY 2108 digits? Are you serious? For what purpose do you need such
accuracy? Are you trying to land a rover next to a particular boulder on
Pluto?

I believe your calculation requirements are beyond the limits of the numeric
datatypes available in VB. Your method of adding the single digits of
strings makes me think there may be a way to use three arrays of longs,
making sure each element stays in the range -999999999 to 999999999 and
keeping track of carrying the one to successive elements. Then format the
elements of the resultant (third) array to strings and append them together.
Might be faster than doing individual digits.

000066000 010000009 900000000
123456789 989999990 900000001
----------------------------------------
123522790 000000000 800000001

For i = 1 To nElements
strResult = strResult & Format(lngResult(i), "000000000")
Next i

"123522790000000000800000001"


"Tom F" wrote:

> I am trying to add some large numbers (between 10^15 and 10^300) and want to
> know the exact values. When VB starts adding the values at that range it
> defaults to using scientific notation. The only solution I've come up with is
> to save the numbers as strings, have VB add each digit, and dump that into
> another string. That works but is slow and resource intensive. To test it I
> calculated 2^x up to x=7000. It took a 2ghz laptop about an hour to get that
> far using that technique and it is only 2108 digits.
>
> Anyway, my question is: Is there a way to tell VB to format to standard
> notation?
.



Relevant Pages

  • Converting numbers to strings without Ada.Text_IO?
    ... I'm writing a collection of generic packages to format numbers (similar to ... determining the result strings' lengths in assignment. ... type Max_Real is digits System.Max_Digits; ...
    (comp.lang.ada)
  • Re: abundance of irrationals!)
    ... >> non-terminating strings of binary digits, ... > In order to form your antidiagonal number, you need too many digits. ... Any terminating sequence of binary digits can be arbitrarily extended ...
    (sci.math)
  • Scientific Notation Format
    ... I NEVER use or can forsee a use for Scientific Notation Format in anything of my spreadsheets. ... significant digits you have to use a different number format than General. ... When we download the payment file, it downloads in the CSV ...
    (microsoft.public.excel.misc)
  • Re: infinity
    ... >> Sure, given S symbols in L digits, you can represent exactly L^S ... If you are required to have infinite ... > strings in an infinite set of strings from a finite alphabet ... Individual naturals are all finite, but the set of all of them has no ...
    (sci.math)
  • Re: infinity
    ... >>> Sure, given S symbols in L digits, you can represent exactly L^S ... If you are required to have infinite ... >> strings in an infinite set of strings from a finite alphabet ... if there is no finite bound on the lengths of the strings, ...
    (sci.math)