Re: Calculating in other bases than 10

Liste des GroupesRevenir à cu shell 
Sujet : Re: Calculating in other bases than 10
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 19. Feb 2025, 06:46:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vp3r8f$24s81$1@dont-email.me>
References : 1
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
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


Date Sujet#  Auteur
18 Feb 25 * Calculating in other bases than 105Janis Papanagnou
18 Feb 25 +- Re: Calculating in other bases than 101Janis Papanagnou
18 Feb 25 +* Re: Calculating in other bases than 102Christian Weisgerber
19 Feb 25 i`- Re: Calculating in other bases than 101Janis Papanagnou
19 Feb 25 `- Re: Calculating in other bases than 101Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal