# Setting precision and machine underflow

As is well known, Mathematica changed how it handles numbers smaller than $MinMachineNumber in recent versions. I'm running Mathematica 12 on a Mac, and I cannot figure out why it's treating these differently:  Exp[-N[2695, $$MachinePrecision]] Exp[-N[2695.0,$$MachinePrecision]]  The top line returns 3.77... times 10^-1171 while the bottom line gives the "too small to represent as a normalized machine number" error and returns zero. Since both numbers are set to MachinePrecision I'd think that the fact that the bottom one has the added .0 is irrelevant, but obviously my understanding is wrong. Running  N[Precision[-N[2695, $$MachinePrecision]]] N[Precision[-N[2695.0,$$MachinePrecision]]]  confirms both exponents have the same precision. I'd greatly appreciate it if someone could explain why Mathematica is treating these differently to me. • Removing the outer N[...] from both will show that they are in fact different. Sep 26, 2019 at 20:56 ## 1 Answer Indeed, that is somewhat odd. The reason is this: Precision[N[2695, $$MachinePrecision]] Precision[N[2695.0,$$MachinePrecision]]  15.9546 MachinePrecision In fact, one has to be careful with the subtle difference between the following two: $MachinePrecision
MachinePrecision


15.9546

MachinePrecision

That is, N[2695, $MachinePrecision] is actually not a machine number but an arbitrary precision number with as many digits as a machine number. Thus, over- and underflows in numerical computations will be treated differently. In the case of N[2695.0,$MachinePrecision], one has to keep in mind that N can never increase the precision (one had to use SetPrecision for that). And MachinePrecision is always treated as smaller precision than any arbitrary precision. So, curiously one has MachinePrecision < $MachinePrecision and N[2695.0,$MachinePrecision] does not change 2695.0 from a machine number to an arbitrary precision number with 15.9546 digits.

In a nutshell:

N[2695, $MachinePrecision] is an arbitrary precision number because (i) 2695 is exact and (ii) $MachinePrecision evaluates to 15.9546.

N[2695.0, $MachinePrecision] is a machine number because (i) 2695.0is a machine number, because (ii) $MachinePrecision evaluates to 15.9546 which is treated by Mathematica as a higher precision than MachinePrecision, and because (iii) N cannot increase the Precision of its input.

• That clarifies a lot, although I still don't understand why Mathematica isn't doing the same thing to both. Why is one an arbitrary precision number but not the other? Sep 26, 2019 at 21:35
• @LaurenPearce In the first case, you end up with an exact number being reduced to an arbitrary precision number with a precision of 15.9546. In the second case, you start out with a machine precision number. To switch it to an arbitrary precision number with precision of 15.9546 is considered by Mathematica to be more precision, and it does not want to increase the precision without an explicit command. You can also try Precision[N[2695, MachinePrecision]]. Using \$MachinePrecision with the dollar sign is the same as typing Precision[N[2695, 15.9546]]. Sep 26, 2019 at 23:13