Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scientific Notation 2

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,963
0
36
US
How would you display this as a whole number (46144876507155500000)?


4.61449E+19

Swi
 
Hi,

Are you asking a question then answering it, or should your answer be followed by a '?' to indicate that you want it confirming?

Anyway, I would display 46144876507155500000 as a whole number as :

46144876507155500000

In scientific notation as:

461448765071555E+5
or
46144876507155.5E+6
or
4614487650715.55E+7
etc

Either way, it will ALWAYS be a whole number.

Your example of scientific notation would lose part of the value of the number and would be incorrect.

You would lose this amount from your original number:

23492844500000

Regards,

Darrylle



"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
I want to convert 4.61449E+19 to the actual number.

Swi
 
The way to deal with Huge Numbers is to use the Variant Data Type, initially populating the variable using the CDec function from a string.
Code:
Dim HugeNumber as Variant
HugeNumber = CDec("79220999999999999999999999999")
HugeNumber = 0
From then on, you can treat it mathematically. The number shown is the approximate maximum value using this approach.

Darrylles - FYI - Scientifc Notation is having based using the powers of ten with the coefficient from 1 to 9. Iother words, only 1 digit to the left of the decimal point. 4.61449E+19 is the only proper use of Scientic Notation for this number.





Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
79228162514264337593543950335 appears to be the maximum value.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
One thing I left out, you must continue to use the CDec function to the keep the decimal intact.
Code:
Dim HugeNumber As Variant
Dim idx As Integer
   
HugeNumber = CDec("79228162514264337593543950335")
HugeNumber = 1
For idx = 1 To 95
   HugeNumber = CDec(HugeNumber * 2)
   Debug.Print idx, HugeNumber
Next idx

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top