
26 Oct
2010
26 Oct
'10
5:27 p.m.
On Tue, Oct 26, 2010 at 10:01, John Maddock
Of course this assumes that parameter "f" is exactly representable as a floating point value, in fact it might need to be a power of 2 in order to be certain of being completely safe and accurate....
"Safe and accurate" is always far beyond my ability to prove when it comes to floating point. Even if f is a power of two, what is something like round2fraction(sqrt(1e41), 4) supposed to do? Perhaps the best it can promise is something like "when the result is displayed with digits10-1 significant figures, it will appear to have been rounded as requested".