I'm puzzled by the output I get from SetAccuracy. According to the documentation, when SetAccuracy is used to increase the accuracy of a number, the number is padded with zeros.
But, let's take a look at a couple of examples:
SetAccuracy[1.2, 5]
(* 1.2000 *)
SetAccuracy[1., 5]
(* 1.0000 *)
SetAccuracy[0.2, 5]
(* 0.2000 *)
These examples seem to work properly, so why does it behave differently in this case?
SetAccuracy[0., 5]
(* 0.*10^-5 *)
What should I do to get a zero with four trailing zeros?
Update
I'm asking this question, because I need to export data to a txt file and I would like to avoid having 0.*10^-5 sort of numbers.
PaddedForm[0., {4, 4}]? – kirma Oct 29 '12 at 11:50NumberForm[0., {1, 4}]will print0.0000– image_doctor Oct 29 '12 at 13:03Export["test.txt", PaddedForm[RandomReal[], {4, 4}]]. – VLC Oct 29 '12 at 13:22StandardForm@NumberForm[0., {4, 4}]. But then again, it is not generic:StandardForm@NumberForm[1200345., {10, 4}]. – VLC Oct 29 '12 at 13:50StandardForm@ NumberForm[1200345., {10, 4}, ExponentFunction -> (Null &)]. I'll check it now extensively. – VLC Oct 29 '12 at 14:02