Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: inf and nan in arithmetic expansions

On Thu, 08 Feb 2018 00:25:46 +0100
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Stephane Chazelas wrote:
> >
> > neither "inf." nor "inf" are understood in arithmetic
> > expressions (and for "inf.", nor by other tools like awk, or
> > even the builtin printf):
> > It should be safe to change zsh so that inf. (and Inf. INF. NAN.
> > nan., maybe also Infinity.) are recognised in arithmetic
> > expression, as it's currently invalid, but that leaves the
> > problem of "inf." not being recognised by other tools
> > (awk/printf).
> There was actually a patch posted back in workers/19597 to do this. I
> don't know why it never got integrated other than that a certain
> amount of integration work was perhaps required.
> It might be possible to forward port that work from 4.1.1 to the current
> release. Would that be welcomed or was the original patch rejected for
> good reasons?

That's fine by me --- I'd completely forgotten.  The math code only
evolves fairly slowly.

I'd be a little bit worried if there were cases that produced errors
before that no longer do.  But given that typically the result is
"inf." with no error at the moment, that may well not be a real problem.


Messages sorted by: Reverse Date, Date, Thread, Author