I am excited about the new fltexpr loadable. It looks like 
it is still a work in progress, and can use some polishing.
It is nice though!

A few things I noticed while I was playing with it:

$ echo ".1 + .2" | bc
.3
$ echo ".1 + .2" | fltexpr
-bash: fltexpr: expression expected
$ fltexpr -p ".1 + .2"
-bash: fltexpr: .1 + .2: arithmetic syntax error: operand expected (error token 
is ".1 + .2")
$ fltexpr -p "0.1 + 0.2"
0.30000000000000004

---

$ fltexpr -p "9.93 + 0.17"
10.1
$ fltexpr -p "10.1 - 9.93"
0.16999999999999993

---

Also, it would be really cool if fltexpr leaves the result in 
var FLTEXPR, or at least if it takes an option "-v VAR", the 
way printf does, so we won't have to do command substitutions.

And, maybe some mention in --help about the functions it supports?
$ fltexpr -p "PI"
3.141592653589793
$ fltexpr -p "sin(1)"
0.8414709848078965
$ fltexpr -p "fmax(-3.4,-5.7)"
-3.4
$ fltexpr -p "sqrt(2)"
1.4142135623730951

Thank you!

--
Pourko


  • About fltexpr pourko--- via Bug reports for the GNU Bourne Again SHell
    • Re: About f... Greg Wooledge
    • Re: About f... Lawrence Velázquez
      • Re: Abo... pourko--- via Bug reports for the GNU Bourne Again SHell
        • Re:... Duncan Roe via Bug reports for the GNU Bourne Again SHell
          • ... Chet Ramey
    • Re: About f... pourko--- via Bug reports for the GNU Bourne Again SHell
      • Re: Abo... Oğuz
        • Re:... pourko--- via Bug reports for the GNU Bourne Again SHell
          • ... Duncan Roe via Bug reports for the GNU Bourne Again SHell
            • ... pourko--- via Bug reports for the GNU Bourne Again SHell

Reply via email to