On Mon, 28 Jul 2008, Peter Gibbs wrote: > ----- Original Message ----- From: "Will Coleda" <[EMAIL PROTECTED]> > > > To properly support $tcl_precision in tcl, I need to change how I'm > > currently implementing {$tcl_precision == 0}. Right now, I just fake
> A few points to ponder. > 1) The default precision for %g in C is 6 significant digits, i.e. 1.57080 > (but sprintf drops trailing zeroes) > 2) 1.5707963267948966 actually corresponds to 17-digit precision (which is the > limit for double), not 16 > 3) tcl uses its own special handling for tcl_precision = 0, refer to > http://www.tcl.tk/cgi-bin/tct/tip/132.html for more information > 4) Look at David Gay's code (see http://www.netlib.org/fp/index.html, > specifically gdtoa) for similar logic > 5) Although I haven't looked, the tcl source code must contain their actual > implementation > > I don't know whether we expect enough usage of Parrot in mathemetical circles > to be worthwhile adding one of these implementions to our version of sprintf. Perl5 certainly gets used in situations where such issues are relevant. Every time we make a change that affects that last digit, we receive bug reports about it. -- Andy Dougherty [EMAIL PROTECTED]