Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
    
Use NumberForm[y, 10] –  Chenminqi Mar 26 at 15:26
    
Perfect. Exactly what I needed. Thanks for your help. –  trent1799 Mar 26 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.