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

I have a couple of complicated user-defined functions, one which calls the other, and I wish to control the number of decimal places displayed when I call the "mother" function. I have tried the obvious


but no matter the choice for n I receive only 6 decimal places. But when I write a simple nested function like

f[x_] := Module[{}, x/3];
g[x_] := Module[{}, f[x]];

and then call

N[g[1], 50]

I receive the requested number of digits (so it doesn't seem to be the nesting causing the issue). Unfortunately I cannot post the actual functions I am playing with due to their size. Any ideas would be appreciated...

share|improve this question

I believe this question is a combination of these:

Specifically, for your function to work as desired most directly (and correctly) it will need to return a number or expression in arbitrary precision. This is (best) done by using arbitrary precision or exact numbers throughout the computation.

Alternately you can use NumberForm to display your output rather than N.

The result can be forced with SetAccuracy with the understanding that your results are fake. See:

share|improve this answer

Your Answer


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.