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

negative bases in arithmetic expressions



$ zsh -c 'echo $((-8#10))'
zsh:1: invalid base (must be 2 to 36 inclusive): -8
$ zsh -c 'echo $((- 8#10))'
-8

I'd rather zsh interpreted $((-8#10)) the same as $((- 8#10))
like other shells do as it's a bit pointless to consider the
sign as being part of the base and then reject anything negative
afterwise.

-- 
Stephane



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