bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Bug in gawk big num


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Bug in gawk big num
Date: Wed, 26 Sep 2018 10:42:51 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Sep 26, 2018 at 08:11:26AM -0600, address@hidden wrote:
> I think you have to check `base == 10' since base could also be 8.

Well, I think "E" is unlikely to appear in any base < 15. :-)

But maybe my patch is stupid: perhaps we should not call mpg_maybe_float if
base is not 10. So perhaps this instead:

        if (base != 10 || ! mpg_maybe_float(cp1, use_locale)) {

Is it possible to have a floating point value that starts with 0x or 0?

> In mpfr_force_num we may have to call get_numbase unconditionally
> in order to recognize that we have a hex value.

When you say "mpfr_force_num", are you referring to mpfr.c:force_mpnum?
Are you saying that the do_nondec argument should be ignored? I don't
follow.

> This begs the larger question of how -v n=0x... should be treated.

In terms of how we handle non-decimal data in command-line variables?
At the moment, I think it's treated as a string, as opposed to a strnum,
unless the --non-decimal-data option is used. That seems OK to me.

> I need to spend some time on this with a debugger and think it through
> some more.

OK. I think one of my two proposed fixes should be roughly correct.
They both pass "make check".

Regards,
Andy



reply via email to

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