1
$\begingroup$

I have a number for instance 0.0622.

I want to put it in ScientificForm so I do ScientificForm[0.0622] obtaining 6.22 x 10^-2

I want to save the power of 10, so the 10^-2 can be used to manipulate a list. Is there a way to do that?

$\endgroup$
1
  • 1
    $\begingroup$ A brute force way is Log10[6.22 10^-2] // Floor which gets you -2. $\endgroup$
    – JimB
    Nov 24 '21 at 1:02
3
$\begingroup$
decimalExponent[x_] := Floor[Log[10, x]]
decimalExponent[0.0622]
(* -2 *)
$\endgroup$
1
$\begingroup$
exponent[x_] := Last@RealDigits[x] - 1

Test

t = Table[10^-i, {i, -10, 10}]
exponent /@ t
{10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, \
-9, -10}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.