MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: SetPrecision - What does in find?

  • To: mathgroup at
  • Subject: [mg48605] Re: SetPrecision - What does in find?
  • From: ab_def at (Maxim)
  • Date: Mon, 7 Jun 2004 05:33:38 -0400 (EDT)
  • References: <c8kcs0$mpv$> <c8mumk$a4t$> <c944pq$r43$> <c96i11$ijt$> <c9ec18$g88$>
  • Sender: owner-wri-mathgroup at

There's a glitch in SetPrecision[n,Infinity] though: it doesn't
preserve the hidden digits of n. Suppose we have n=1`20/3; Mathematica
will generate a number with 40 threes, 20 of which will be
significant. Now if we do SetPrecision[n,50], then Mathematica firstly
will use the hidden digits and only after that the number will be
padded with zeros. This means that SetPrecision[n,50]-1/3 is
approximately 10^-40:

SetPrecision[1`20/3, 50] - 1/3 // N


This works just as described in the documentation; but if we do
SetPrecision[n,Infinity], then only the 20 significant digits are

SetPrecision[1`20/3, Infinity] - 1/3 // N


Maxim Rytin
m.r at

  • Prev by Date: Max [a,-inf]
  • Next by Date: Where does Return return to?
  • Previous by thread: Max [a,-inf]
  • Next by thread: Where does Return return to?