From 4db5da923aa9f7a516776fecbe65b8297e20ae6a Mon Sep 17 00:00:00 2001 From: Mark Lavi Date: Sat, 13 Oct 2018 23:31:48 -0500 Subject: [PATCH] Empty page, so here's my contributed research. --- SC2079.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 SC2079.md diff --git a/SC2079.md b/SC2079.md new file mode 100644 index 0000000..19d880e --- /dev/null +++ b/SC2079.md @@ -0,0 +1,6 @@ +# (( )) doesn't support decimals. Use bc or awk. + +Bash [arithmetic conditional evaluation can only be performed on integers](https://www.tldp.org/LDP/abs/html/comparison-ops.html). More detail: Bash has limited data types which [include integer](http://www.tldp.org/LDP/abs/html/declareref.html), but everything is effectively [untyped](http://www.tldp.org/LDP/abs/html/untyped.html). + +Suggested workarounds to this constraint use bc or awk, here are +[some examples](https://stackoverflow.com/questions/11237794/how-to-compare-two-decimal-numbers-in-bash-awk). \ No newline at end of file