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

Re: test if a parameter is numeric



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