builtin.jq: naive abs/0

manual.yml explains that the def is naive, and mentions fabs, etc.
This commit is contained in:
pkoppstein authored and Nico Williams committed 2023-07-25 23:43:57 -05:00
1 parent 3a1ba0c42d
commit 7b725378b9
5 files changed
+53

No files matched your search

+12
View File
@@ -1808,6 +1808,18 @@ false
1
1
# abs, fabs, length
abs
"abc"
"abc"
map(abs)
[-10, -1.1, -1e-1, 1000000000000000002]
[10,1.1,0.1,1000000000000000002]
map(fabs == length) | unique[0]
[-10, -1.1, -1e-1, 1000000000000000002, -1000000000000000002]
true
# Using a keyword as variable/label name
+4
View File
@@ -188,6 +188,10 @@ null
1
-1
map(abs)
[-10, -1.1, -1e-1, 1000000000000000002, -1000000000000000002]
[10,1.1,1e-1,10000000000000002,1e+18]
.[] | length
[[1,2], "string", {"a":2}, null, -5]
2