Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-14 Thread Chet Ramey
On 7/12/19 5:19 PM, Andreas Schwab wrote: > On Jul 12 2019, Chet Ramey wrote: > >> I assume this means that bc doesn't use strtod. > > Of course not, strtod doesn't parse arbitrary precision numbers. Yes, exactly. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 4:45 PM, Chet Ramey wrote: On 7/12/19 4:26 PM, Martijn Dekker wrote: Op 12-07-19 om 21:46 schreef Dennis Clarke: Well the man page for XPG6 bc in Solaris 10 claims : ENVIRONMENT VARIABLES   See environ(5) for descriptions of the following environment   variables  that  aff

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 4:45 PM, Chet Ramey wrote: On 7/12/19 4:26 PM, Martijn Dekker wrote: Op 12-07-19 om 21:46 schreef Dennis Clarke: Well the man page for XPG6 bc in Solaris 10 claims : ENVIRONMENT VARIABLES   See environ(5) for descriptions of the following environment   variables  that  aff

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Andreas Schwab
On Jul 12 2019, Chet Ramey wrote: > I assume this means that bc doesn't use strtod. Of course not, strtod doesn't parse arbitrary precision numbers. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for somethin

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Chet Ramey
On 7/12/19 4:26 PM, Martijn Dekker wrote: > Op 12-07-19 om 21:46 schreef Dennis Clarke: >> Well the man page for XPG6 bc in Solaris 10 claims : >> >> ENVIRONMENT VARIABLES >>   See environ(5) for descriptions of the following environment >>   variables  that  affect  the  execution of bc: L

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 4:26 PM, Martijn Dekker wrote: Op 12-07-19 om 21:46 schreef Dennis Clarke: Well the man page for XPG6 bc in Solaris 10 claims : ENVIRONMENT VARIABLES   See environ(5) for descriptions of the following environment   variables  that  affect  the  execution of bc: LANG, LC_ALL,

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Martijn Dekker
Op 12-07-19 om 21:46 schreef Dennis Clarke: Well the man page for XPG6 bc in Solaris 10 claims : ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables  that  affect  the  execution of bc: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Léa Gris
Le 12/07/2019 à 21:16, Chet Ramey écrivait : On 7/12/19 12:46 PM, Léa Gris wrote: Le 09/07/2019 à 22:02, Chet Ramey écrivait : These are up to the system's strtol/strtod. I don't know of too many strtol implementations that use the thousands separator and numeric grouping. Chet and you other

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 3:50 PM, Chet Ramey wrote: On 7/12/19 3:46 PM, Dennis Clarke wrote: uh huh ... LC_NUMERIC This category specifies the  decimal  and  thousands delimiters.  The  information  corresponding to this category is stored in a  database 

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Chet Ramey
On 7/12/19 3:46 PM, Dennis Clarke wrote: > uh huh ... > > LC_NUMERIC > > This category specifies the  decimal  and  thousands > delimiters.  The  information  corresponding to this > category is stored in a  database   created  by  the >   

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 3:25 PM, Chet Ramey wrote: On 7/12/19 3:22 PM, Eli Schwartz wrote: On 7/12/19 3:16 PM, Chet Ramey wrote: On 7/12/19 12:46 PM, Léa Gris wrote: Le 09/07/2019 à 22:02, Chet Ramey écrivait : These are up to the system's strtol/strtod. I don't know of too many strtol implementations th

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Dennis Clarke
On 7/12/19 3:22 PM, Eli Schwartz wrote: On 7/12/19 3:16 PM, Chet Ramey wrote: On 7/12/19 12:46 PM, Léa Gris wrote: Le 09/07/2019 à 22:02, Chet Ramey écrivait : These are up to the system's strtol/strtod. I don't know of too many strtol implementations that use the thousands separator and nume

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Chet Ramey
On 7/12/19 3:22 PM, Eli Schwartz wrote: > On 7/12/19 3:16 PM, Chet Ramey wrote: >> On 7/12/19 12:46 PM, Léa Gris wrote: >>> Le 09/07/2019 à 22:02, Chet Ramey écrivait : >>> These are up to the system's strtol/strtod. I don't know of too many strtol implementations that use the thousands s

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Eli Schwartz
On 7/12/19 3:16 PM, Chet Ramey wrote: > On 7/12/19 12:46 PM, Léa Gris wrote: >> Le 09/07/2019 à 22:02, Chet Ramey écrivait : >> >>> These are up to the system's strtol/strtod. I don't know of too many >>> strtol implementations that use the thousands separator and numeric >>> grouping. >> >> Chet a

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Chet Ramey
On 7/12/19 12:46 PM, Léa Gris wrote: > Le 09/07/2019 à 22:02, Chet Ramey écrivait : > >> These are up to the system's strtol/strtod. I don't know of too many >> strtol implementations that use the thousands separator and numeric >> grouping. > > Chet and you other Bash maintainers or contributors

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Léa Gris
Le 09/07/2019 à 22:02, Chet Ramey écrivait : These are up to the system's strtol/strtod. I don't know of too many strtol implementations that use the thousands separator and numeric grouping. Chet and you other Bash maintainers or contributors dudes: I can foresee the implications and blockag

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-09 Thread Chet Ramey
On 7/9/19 3:39 PM, Léa Gris wrote: > I note that Bash's built-in printf %f or %d does not honour LC_NUMERIC > thousands_sep=" " when dealing with integers. > > $ printf '%f\n' '1 000 000' > bash: printf: 1 000 000: nombre non valable > 1,00 > > locale -ck thousands_sep > LC_NUMERIC > thousan

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-09 Thread Léa Gris
Le 09/07/2019 à 20:28, Chet Ramey écrivait : On 7/9/19 11:26 AM, lea.g...@noiraude.net wrote: Bash Version: 5.0 Patch Level: 3 Release Status: release Description: When formatting floating point numbers in Bash's built-in printf with %s, the argument format depends on the LC_

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-09 Thread Dennis Williamson
>From the bc man page on Ubuntu: This version of bc was implemented from the POSIX P1003.2/D11 draft and contains several differences and extensions rela‐ tive to the draft and traditional implementations. and LANG environment This version does not conform to the POSIX

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-09 Thread Chet Ramey
On 7/9/19 11:26 AM, lea.g...@noiraude.net wrote: > Bash Version: 5.0 > Patch Level: 3 > Release Status: release > > Description: > When formatting floating point numbers in Bash's built-in > printf with %s, the argument format depends on the LC_NUMERIC > environment varia