Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
negative bases in arithmetic expressions
- X-seq: zsh-workers 43260
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: negative bases in arithmetic expressions
- Date: Wed, 8 Aug 2018 16:37:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=26bavJiQx3UNFYDVwyw3DIRflNEHYAsJVEkZYeznp0w=; b=NNY3NXTQKpHG6IkhKBCmZQW8/hwyP6RrpveDI3IJj4B41bhpi+IheVTYr7OnieNB34 SvueKHTYmAe19cKxwZjLsQMfB2EEZcOwh0H6ODETjtQGlUuKns/k2c1bz+DWdATQ2zAX ULWtorjUEkD/nq4gktnnfm/4PGpwubclMiQGhAnd69r0WtsXN+K3b/3pFSYbN5nEeMcD PRHvchSsMqA+qD150nMgVNR3PU42fsIq58m/xgyuFGye9H/7gjyk0H4sCDGEVQq34iOj 2sGLw3oJ7AeWV+fqD9CrqVk6qubjPrIcA+Tp7fQQDhKAAq37ezVgX/XUTAlxcTjY/wHX h5fg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
$ 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