bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk number to string bug


From: Andrew J. Schorr
Subject: Re: gawk number to string bug
Date: Fri, 23 Dec 2005 15:57:38 -0500
User-agent: Mutt/1.4.1i

On Thu, Dec 22, 2005 at 10:00:05AM -0500, Andrew J. Schorr wrote:
> This works fine.  But what if we increase that precision beyond 30?
> 
>   $ gawk 'BEGIN {printf "%.40d\n",5}'
>   gawk: cmd. line:1: fatal error: internal error
>   Abort (core dumped)

The attached patch seems to fix the problem, although it might
be desirable to turn the PREPEND macro into a function.  Feedback
on that would be appreciated.

If we can agree on this approach, then the next step is to use
snprintf("%.0f") to implement "%d" formatting (using a 2nd dynamically
growing buffer for the initial snprintf rendering)...

Regards,
Andy

Attachment: format_tree.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]