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

Re: sh emulation POSIX non-conformances ("inf"/"Inf" in arithmetic expressions)



BTW, there's also:

$ var=42 zsh -c 'printf "%g\n" var'
42
$ Infinity=42 zsh -c 'printf "%g\n" Infinity'
inf

In ksh93:

$ var=42 ksh -c 'printf "%g\n" var'
42
$ Infinity=42 ksh -c 'printf "%g\n" Infinity'
42

POSIX leaves it implementation-defined whether %g/%f... are
supported, but I'd expect it requires that "inf" output in the
second case where it is (as that's what strtod() returns), so
zsh would be more compliant than ksh in that regard.

There's still possibly scope for improving documentation.

IMO, the code doesn't need to be changed to add warnings.

-- 
Stephane




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