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
Printable View
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
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)
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?
Regardless of any conversion formulas VB cannot display such big numbers.
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.
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.
Actually String type can display but it would be beyond VB to process.
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)
6.01041161091083E+120
?