bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: REQUEST - bash floating point math support


From: Zachary Santer
Subject: Re: REQUEST - bash floating point math support
Date: Mon, 17 Jun 2024 08:04:03 -0400

On Mon, Jun 17, 2024 at 3:48 AM Léa Gris <lea.gris@noiraude.net> wrote:
>
> Le 17/06/2024 à 09:17, Koichi Murase écrivait :
> >    declare -i numvar=${localeFormatted/[!0-9]/.}
>
> This would break with negative numbers.
>
> I know no other radix separator than comma or dot. If there are other
> radix to replace, it can be listed in a character class.
>
> Lets say there are locales that uses , ; or :
>
> declare -i numvar=${localeFormatted/[,;:]/.}

Do different locales use different characters in the place of 'e' in
"[-]d.ddde±dd" and 'p' in  "[-]0xh.hhhhp±d"? (These pulled out of 'man
3p fprintf' - the 'e' and 'a' conversion specifiers.)

If floating point math support is added to bash, I would expect it to
be able to handle floating point literals in these forms as well. I'm
assuming that floating point literals can be specified in C source
code in these forms. Another reason why this is more work than it
looks like from the surface.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]