I have a Physics problem which huge and tiny numbers and Mathematica just gives me a speed of my particles which is the speed of light. Then $1/\sqrt{1-v^2/c^2}$ becomes singular.

If I use smaller values for my radius r, it works, but with the radius of 300 light years, I just get error messages.

Is there some way to increase the precision or something like that?


  • $\begingroup$ Have you tried using e.g. q = SetPrecision[q, 50] on all numeric variables? You could also try Rationalize. Be aware that either of these will be generating false precision. $\endgroup$
    – Mr.Wizard
    Jun 16 '12 at 20:26
  • 1
    $\begingroup$ I tried SetPrecision[number, Infinity] and it works now. I am aware that the precision of my answer is not correct, but I just need it for a Physics homework example. $\endgroup$ Jun 16 '12 at 20:32
  • $\begingroup$ okay, I'll post that as an answer. $\endgroup$
    – Mr.Wizard
    Jun 16 '12 at 20:34
  • 3
    $\begingroup$ Did you consider using Hartree Units? en.wikipedia.org/wiki/Natural_units#Summary_table $\endgroup$ Jun 16 '12 at 20:40
  • $\begingroup$ @belisarius: Interesting! I usually only use SI since I avoid any conversion then. I'll put that in the back of my mind though. $\endgroup$ Jun 16 '12 at 20:43

You can use SetPrecision to set the interpreted precision of a numeric value, or Rationalize to convert it into an exact value.

Be cautious about manufacturing false precision.


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.