On Fri, May 18, 2007 at 08:24:53PM +0200, Bruno Haible wrote: > On mingw and BeOS, the native *printf functions don't support 'long double' > arguments. This works around it. > > Conversion of floating-point numbers to decimal requires intermediate numbers > arbitrary length, either multiprecision integers or multiprecision floating- > point numbers. Multiprecision integers are simpler to implement, so I chose > this approach. The code contains a "mini GMP". All algorithms (multiplication, > division, conversion to decimal) are O(N^2) in the length N of the numbers. > Don't expect that conversion of 1e3000 to decimal will be fast...
Gosh, that's a huge amount of scary code (actually from GMP?). Shouldn't you at least write in the documentation that the conversion may be unusably slow? I know I wouldn't use this in GDB with user input if it might take all year; that's hardly more useful. -- Daniel Jacobowitz CodeSourcery