|
-
Oct 7th, 2002, 07:31 AM
#1
Thread Starter
Hyperactive Member
converting double value
I have a huge number which of course has been stored in a double like this:
6.01041161091083E+120
My question is how do we convert such a number back into its full form
-
Oct 7th, 2002, 07:36 AM
#2
If I'm not mistaken, which I probably am (and am open to correction) - never can remember the scientific notation properly, you multipy the number(s) from before the E+120 by 10 ^ 120. I.E: 6.01041161091083 * (10 ^ 120)
-
Oct 7th, 2002, 07:43 AM
#3
Thread Starter
Hyperactive Member
well thats what i thought... but then that way, the scientific notation VB is using isn't precision. The real value was:
6010411610910832120109108110115581186134117114110581159910410110997115451091059911411111511110211645 991111095811810910834
it contracted it to:
6.01041161091083E+120
So that means it isn't precision, am i right?
-
Oct 7th, 2002, 07:44 AM
#4
PowerPoster
Regardless of any conversion formulas VB cannot display such big numbers.
-
Oct 7th, 2002, 07:45 AM
#5
Thread Starter
Hyperactive Member
and does anyone know any other scientific notation method that could contract such a number (with absolute precision) to not more than 20 or 30 characters.
-
Oct 7th, 2002, 07:47 AM
#6
I believe the most precise variable type is a variant with subtype decimal.
EDIT: unfortunately a decimal cannot handle numbers as big as yours.
From MSDN:
+/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is
+/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001.
Last edited by Frans C; Oct 7th, 2002 at 07:54 AM.
-
Oct 7th, 2002, 07:49 AM
#7
PowerPoster
Actually String type can display but it would be beyond VB to process.
-
Oct 7th, 2002, 07:55 AM
#8
Thread Starter
Hyperactive Member
i guess the variant will work
now my other question. Does anyone know how to express a number as large as that in less than 50 characters using their own notation method (with 100% precision)
-
Oct 7th, 2002, 08:14 AM
#9
I wonder how many charact
-
Oct 7th, 2002, 08:17 AM
#10
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|