Re: avoid scientific notation



Tom,

If you have a math or engineering background, take a close look at floating
point Double Precision and at Long Integers. You can probably scale your
problem, and it's likely that Doubles can take care of your calculation
needs unless there are a *very* large number of small values or a mix of
large and very small values. The math operations you are performing can
have a huge effect as well. Even in handling extreme mixed sizes, if you'll
start processing with the small values you can reduce your truncation error
significantly.

There are few problems that cannot be solved with Double Precision floating
point, but I'm sure some do exist.

If you explicitly need to process values with a very large number of digits
I strongly recommend you search out an add-on math library to do this for
you. If write that kind of library yourself, you're likely to be a very old
man before you get it written and tested<g>. "And tested" is the key here.
You will be dealing with a lot of boundary conditions and testing will be
fairly complex.

As for using another language, the only way you're going to get much speed
improvement is to find a language with a native data type of the precision
you're looking for. I don't know of one, but you might check current
FORTRAN compilers (that's where you'll find computational focus).

Dan



"Tom F" <TomF@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6F29B1FB-2D53-4DDE-B240-E0ACBE85B4A1@xxxxxxxxxxxxxxxx
> No trips to pluto, just trying to add a lot of large numbers. I had
> thought
> of eventually using more that one digit at a time like you suggested below
> but saw that would still be limited at about 15 digits at a time.
>
> I kinda assumed that VB didn't have that functionality built and the
> various
> posts seem to have confirmed it.
> I do appreciate everyone's suggestions though.
>
> I have one other question. I am most comfortable using VB 6.0 but wonder
> how
> much speed could be gained if I did this kind of application using C++ or
> Java. I wouldn't expect much since this is just number crunching but
> wonder
> if anyone could give any insight?
>
> Thanks!
>
> "Charlie" wrote:
>
>> 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"
>


.



Relevant Pages

  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... precision numbers in oracle, you've got 38 decimal digits to play ... and with minimal coaxing perl will handle them as ... digits from a 32 bit floating point number - I'll go out on a limb ... and hazard that one can expect 12 or so digits from a 64 bit floating ...
    (perl.dbi.users)
  • Re: Linear Algebra Challenge
    ... Since I'm using floating point, so I'll never be able to calculate one ... floating point math set to 99 digits. ... As close as I'm willing to wait if I use arbitrary precision. ... This mode is fast; when you select arbitry ...
    (comp.sys.hp48)
  • Re: Interesting math
    ... Floating point number represents a real number with 6 digits precision. ... Floating point numbers are denoted by the keyword float. ...
    (alt.usage.english)
  • Re: Which free software could acquire 48 bits color depth pictures from a scanner ?
    ... Which, of course, is meaningless unless you define the format of the ... floating point math on it and expect to keep the level of precision ...
    (rec.photo.digital)
  • Re: Interesting math
    ... Floating point number represents a real number with 6 digits precision. ... Floating point numbers are denoted by the keyword float. ...
    (alt.usage.english)

Quantcast