Package: wnpp Severity: wishlist Owner: mikachelya <[email protected]> X-Debbugs-Cc: [email protected]
* Package name : flexpr Version : 1.1.2 Upstream Contact: mikachelya <[email protected]> * URL : https://github.com/mikachelya/flexpr * License : MIT Programming Lang: C Description : fast CLI floating-point calculator for shell scripts flexpr is a command line calculator designed to complement the common 'expr' utility. It provides double-precision floating point calculation with logic capabilities. Comparisons are facilitated by a customizable epsilon value or a tolerance measured in ULPs. Whitespace is ignored and any number of command line arguments are parsed. flexpr was written using purely the C standard library. I am aware that there are other packages that provide similar capabilities. However, flexpr has advantages over all of them. Being fairly lightweight, it is faster than every other package I tested: flexpr "1.5 * 2.5 + 3.5" ran 1.19 ± 0.21 times faster than awk 'BEGIN {print 1.5 * 2.5 + 3.5}' 1.25 ± 0.23 times faster than bc <<< "1.5 * 2.5 + 3.5" 1.59 ± 0.26 times faster than calc "1.5 * 2.5 + 3.5" 3.57 ± 0.54 times faster than jq -n "1.5 * 2.5 + 3.5" 26.78 ± 3.81 times faster than python3 -c "print(1.5 * 2.5 + 3.5)" With flexpr being designed specifically for shell scripts, it offers more ergonomic syntax than other packages, for instance with the --logical (-L) flag designed for use in if statements: $ if flexpr -L "0.1 + 0.2 == 0.3"; then echo equal; fi equal flexpr also offers customizable epsilon/ULP tolerance values. As the author of the software, I intend to maintain the Debian package. I am looking for a sponsor to help upload it to the archive.

