Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: test if a parameter is numeric
- X-seq: zsh-users 11188
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: test if a parameter is numeric
- Date: Sat, 10 Feb 2007 20:38:45 +0000
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <070210112235.ZM6640@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns98D2ADD16C100zzappergmailcom@xxxxxxxxxxx> <070209182939.ZM18654@xxxxxxxxxxxxxxxxxxxxxx> <20070210083511.GA4522@xxxxxxxxxxxxxxx> <070210112235.ZM6640@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
On Sat, Feb 10, 2007 at 11:22:35AM -0800, Bart Schaefer wrote:
[...]
> % typeset -i 40 x
> % x=39
> % echo $x
> 40#^
>
> Zsh is choosing "^" to represent 39 in base 40 because carat is the 29th
> ASCII character after capital A, so the base 40 "digits" are
> 0123456789ABC...XYZ[\]^
[...]
Hi,
apparently, only the 5 lower bits matter as I found out, that's
why $((40#^)) is the same as $((40#~))
[...]
> % echo $((##^))
> 94
[...]
Here:
$ echo $((##^))
0
(zsh 4.3.2 from debian package 4.3.2-25)
zsh 4.3.2-dev-1+20070206-1 is OK though.
37 is $((40#\\))
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author