Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.unix.shell Subject: Re: Calculating in other bases than 10 Date: Wed, 19 Feb 2025 06:46:54 +0100 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 19 Feb 2025 06:46:59 +0100 (CET) Injection-Info: dont-email.me; posting-host="8d21927c3b252a23dbfdb299b6fc0a86"; logging-data="2257153"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q+NlUrl9KmYsih5L2HCCT" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:/8+xbicmmX3Z1i1h8Jf94Y4JMjQ= In-Reply-To: Bytes: 1658 On 18.02.2025 10:59, Janis Papanagnou wrote: > [...] > > BTW, Kornshell operates with bases up to 64 and I wonder what symbols > are used for that. Tests show that it depends on the base; for small > bases letters in caps are handled like lowercase letters, for larger > bases using caps matters, and for some bases we even get errors, e.g. > > $ echo $((37#ff)) > 570 > $ echo $((37#FF)) > ksh: 37#FF: arithmetic syntax error > > Looks like a bug to me. ....but it isn't! - As I've been pointed out base 37 just means that 0-9, a-z, and A are accepted as digits, which of course makes sense. Janis