$ fltexpr -p inf
inf
$ fltexpr -p 10**1
inf
$ fltexpr -p 1e1
bash: fltexpr: 1e1: number out of range (error token is "1e1")
can you just ignore erange? strtod returns an infinity in that case
in other interpreted languages, 1e1 is:
- inf in ksh93 and lua
- 'inf' in perl
- INF
for context, this came up when trying to do $((foo[bar[i%${#bar[@]}]]))
which has no immediate equivalent without $
On Mon, Jun 30, 2025, 19:45 Robert Elz wrote:
> Date:Mon, 30 Jun 2025 10:44:24 -0400
> From:Greg Wooledge
> Message-ID: <20250630144424.gj32...@wooled
this causes a parser error since commit 35bc7025
a=(0 1 2)
b=(0 1 2)
x=0
((i=$x,a[b[i]]))
using $ anywhere in (( )) makes subscripts not expandable
Dunno if it's "considerably easier", my patch just added 1 sign argument to
1 function and fixed up a couple of call sites.
Your way is shorter but it boils down to "if the micro-part is negative it
means that the number was in (-1,0)", which for some reason was already
being checked for despite no
haven't really looked into why this happens but x[ seems to trigger some
funny parser behavior
x[ newline should not prompt with PS2
it can't be defined as a normal sh function, but it can be defined with the
function keyword
it can't be called like a normal function, but things like "x[" or