[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pkl,std: add `format_f32' and `format_f64' std functions
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [PATCH] pkl,std: add `format_f32' and `format_f64' std functions |
Date: |
Sun, 8 Jan 2023 10:17:06 +0100 |
Hi Jose.
On Sun, Jan 08, 2023 at 12:21:28AM +0100, Jose E. Marchesi wrote:
>
> Hi Mohammad.
>
> > This commit adds two new library functions to create string
> > representation of single/double-precision floating-point numbers
> > from uint<32>/uint<64>.
>
> Wouldn't it be better to add support for %f, %e and %g to `format' and
> `printf' instead of having these library functions?
>
Yes, but implementing two new functions was easier :)
Are you OK with the following syntax?
"%f32d" // float32 in base 10
"%f64d" // float64 in base 10
// With explicit precision
"%f32.7d"
"%f64.15d"
// And other styles
"%e32d"
"%e64d"
"%g32d"
"%g64d"
In future we can also support other bases (like "%f32b" or "%f64x").
Regards,
Mohammad-Reza
- [PATCH] pkl,std: add `format_f32' and `format_f64' std functions, Mohammad-Reza Nabipoor, 2023/01/07
- Re: [PATCH] pkl,std: add `format_f32' and `format_f64' std functions, Jose E. Marchesi, 2023/01/07
- Re: [PATCH] pkl,std: add `format_f32' and `format_f64' std functions,
Mohammad-Reza Nabipoor <=
- Re: [PATCH] pkl,std: add `format_f32' and `format_f64' std functions, Jose E. Marchesi, 2023/01/08
- [PATCH v2 1/2] pkl, testsuite: add support for printing/formatting floating-points, Mohammad-Reza Nabipoor, 2023/01/08
- [PATCH v2 2/2] pickles: add new pickle for floating-point numbers, Mohammad-Reza Nabipoor, 2023/01/08
- Re: [PATCH v2 2/2] pickles: add new pickle for floating-point numbers, Jose E. Marchesi, 2023/01/08
- Re: [PATCH v2 1/2] pkl,testsuite: add support for printing/formatting floating-points, Jose E. Marchesi, 2023/01/08
- [PATCH v3] pkl, testsuite: add support for printing/formatting floating-points, Mohammad-Reza Nabipoor, 2023/01/10
- Re: [PATCH v3] pkl,testsuite: add support for printing/formatting floating-points, Jose E. Marchesi, 2023/01/10
- Re: [PATCH v3] pkl,testsuite: add support for printing/formatting floating-points, Mohammad-Reza Nabipoor, 2023/01/11