[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: *printf: support for 'long double' number output
From: |
Daniel Jacobowitz |
Subject: |
Re: *printf: support for 'long double' number output |
Date: |
Fri, 18 May 2007 15:04:03 -0400 |
User-agent: |
Mutt/1.5.15 (2007-04-09) |
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