[Date Prev ][Date Next ][Thread Prev ][Thread Next ][Date Index ][Thread Index ]
Re: About fltexpr
From :
Chet Ramey
Subject :
Re: About fltexpr
Date :
Tue, 23 Sep 2025 14:39:35 -0400
User-agent :
Mozilla Thunderbird
On 9/21/25 1:22 PM, pourko--- via Bug reports for the GNU Bourne Again
SHell wrote:
A few things I noticed while I was playing with it:
$ echo ".1 + .2" | bc
.3
$ echo ".1 + .2" | fltexpr
-bash: fltexpr: expression expected
Correct; it is not bc and does not read from standard input.
$ fltexpr -p ".1 + .2"
-bash: fltexpr: .1 + .2: arithmetic syntax error: operand expected (error token is
".1 + .2")
Its heritage as a modification of `let' peeking out there.
$ fltexpr -p "0.1 + 0.2"
0.30000000000000004
That is the minimal representation that will survive a round-trip from
double to string to double. Look at fltexpr.c:fltexpr_format().
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
Re: About fltexpr , (continued)
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr , Lawrence Velázquez , 2025/09/21
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr , Lawrence Velázquez , 2025/09/21
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr , Greg Wooledge , 2025/09/21
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr , Greg Wooledge , 2025/09/21
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr , pourko , 2025/09/21
Re: About fltexpr ,
Chet Ramey <=
Re: About fltexpr , Stan Marsh , 2025/09/21
Re: About fltexpr , Stan Marsh , 2025/09/21
Re: About fltexpr , Stan Marsh , 2025/09/21