Closed
Description
Describe the bug
I want to divide an integer representing a throughput in bits/sec
by 10^9
to get Gbits/sec
but I get pow/1 is not defined
errors.
To Reproduce
$ echo 7223210000 | jq -r './pow(10,9) | tostring + " bits/sec"'
jq: error: pow/1 is not defined at <top-level>, line 1:
./pow(10,9) | tostring + " bits/sec"
jq: 1 compile error
$ echo 7223210000 | jq -r './pow10(9) | tostring + " bits/sec"'
jq: error: pow10/1 is not defined at <top-level>, line 1:
./pow10(9) | tostring + " bits/sec"
jq: 1 compile error
Expected behavior
$ echo 7223210000 | jq -r './pow(10,9) | tostring + " bits/sec"'
7.22321 bits/sec
$ echo 7223210000 | jq -r './pow10(9) | tostring + " bits/sec"'
7.22321 bits/sec
Environment (please complete the following information):
- OS and Version: Linux CentOS 7.9
- jq version 1.5
Additional context
jq
has been built with maths functions ( -lm
) :
$ ldd $(which jq) | grep libm
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fa9155a9000)
$ rpm -qf /usr/lib64/libm.so.6
glibc-2.17-325.el7_9.x86_64
Metadata
Metadata
Assignees
Labels
No labels