Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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 function that contains a For loop and sometimes takes several hours to run. It's important that I keep a high precision, and I insert Print statements throughout to check the status. Here is a simplified example:

f[x_] := Block[{$MinPrecision = 500},
    For[i = 0, i < x, i++;
        y = i/2;
        Print[N[y, 10]]
    ];
];

Is there a way to ignore or suppress $MinPrecision when Print is used? I'd like to make the printed output easier to read.

share|improve this question
1  
Use NumberForm[y, 10] – Apple Mar 26 '14 at 15:26
    
Perfect. Exactly what I needed. Thanks for your help. – tn3rt Mar 26 '14 at 15:50

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.