bug-gawk
[Top][All Lists]
Advanced

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

Re: complie with mpfr support


From: Ivan Molineris
Subject: Re: complie with mpfr support
Date: Tue, 9 Feb 2021 16:17:04 +0100

Indeed on Ubuntu gawk seems to be compiled with MPFR support.

I would have thought that, when compiled with MPFR support, a command like
$ echo 1.8e-308 | gawk '$1<0.05'
will return "1.8e-308", but is not the case, it returns nothing.

For me is not feasible to modify all my scripts to do something like
$ echo 1.8e-308 | gawk '$1+0<0.05'
as a workaround.

Is there a better solution?


On Thu, Feb 4, 2021 at 8:55 PM <arnold@skeeve.com> wrote:

> Ivan Molineris <ivan.molineris@gmail.com> wrote:
>
> > Hi all,
> > I would like to avoid problems like this one:
> >
> https://stackoverflow.com/questions/20684195/awk-and-numeric-comparison-with-number-less-than-1-7e-308
> >
> > If I understood well, if gawk is compiled with mpfr support, invoking it
> > with -M solve the problem.
> >
> > I tried to install mpfr whit
> > $ conda create -n gawk-compile -c conda-forge mpfr
> > and to configure ad compile gawk in this environment, but -M is still not
> > available.
> > How can I compile gawk with mpfr?
> >
> > Regards
>
> I have no idea what conda is or how it works.  I assume it's on some
> kind of Linux system?
>
> The simplest thing is to comple the GMP and MPFR libraries from
> source and install then and then compile gawk from source with the
> standard configure and make recipe.
>
> If you're on a Linux system with gawk already installed, maybe it was
> compiled with MPFR support already?  The output of gawk --version will
> show you the MPFR and GMP versions if so.
>
> HTH,
>
> Arnold
>


reply via email to

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