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    [email protected]    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to