Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to evaluate numerically $e^{-4 \cdotp 10^{35}}$ in the form $0,a_1a_2...\times 10^{-n}$

N[E^(-4*10^35)]  

General::unfl: Underflow occurred in computation. >>
Underflow[]

doesn't work

share|improve this question
    
How many digits would you be satisfied with? – Michael E2 Feb 25 at 0:11
n = 35;
{pow, logdec} = {#[[1]][[;; #[[2]]]], #[[1]][[#[[2]] + 1 ;;]]} &@
                            RealDigits[N[Log[10, E^(-4 10^n)], 200]];

So there are

FromDigits@pow

(* 173717792761300731060451567566642032 *)

zeroes,followed by

dec = N[1/10^(FromDigits[logdec] 10^-Length[logdec]), 50]

(* 0.12084848148616706326389685430970719629910021783715 *)

... or may be I'm off by one :)


Checking with smaller numbers:

n=4;
{pow, logdec} = {#[[1]][[;; #[[2]]]], #[[1]][[#[[2]] + 1 ;;]]} &@
                 RealDigits[N[Log[10, E^(-4 10^n)], 200]];
FromDigits@pow
(* 17371 *)
dec = N[1/10^(FromDigits[logdec] 10^-Length[logdec]), 50]
0.16623553671520518223181112083319039297273582477854

E^(-4 10^n) // N
(* 1.66235536715*10^-17372 *)
share|improve this answer
    
Somewhat simpler: exp = -4*10^35; tenExp = Floor[exp/Log[10]]; rem = exp - tenExp Log[10]; N[Exp[rem], 50]*Inactivate@Power[10, tenExp] Also, rem can be written as Mod[exp, Log[10]] but I wanted to make sure (and make it obvious) that the integer and fractional part add up right. – The Vee Mar 19 at 23:59
$MinMachineNumber

$\text{2.2250738585072014$\grave{ }$*${}^{\wedge}$-308}$

and as Karsten 7 points out:

Log[$MinNumber] 

$-3.121657384082590881601471993929\times 10^{15}$


Use Exp[x] == 10^(x/Log[10])

and Exp[a b] = Exp[a] + Exp[b] to find:

$0.0183156\ 10^{-10^{35}}$

share|improve this answer
1  
That's for machine-precision. $MinNumber is more relevant here. – Karsten 7. Feb 24 at 23:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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