]> granicus.if.org Git - jq/commitdiff
Document math support
authorNicolas Williams <nico@cryptonector.com>
Sat, 4 Jul 2015 02:19:01 +0000 (21:19 -0500)
committerNicolas Williams <nico@cryptonector.com>
Sat, 4 Jul 2015 02:19:01 +0000 (21:19 -0500)
docs/content/3.manual/manual.yml

index 068246e12606743f2eaf92c918f750155daec7b5..7d926750713b665234b2dbc288a0d3194108bb4c 100644 (file)
@@ -2476,6 +2476,24 @@ sections:
             input: '1'
             output: ['[1,2,4,8,16,32,64]']
 
+  - title: 'Math'
+    body: |
+
+      jq currently only has IEEE754 double-precision (64-bit) floating
+      point number support.
+
+      Besides simple arithmetic operators such as `+`, jq also has most
+      standard math functions from the C math library.  C math functions
+      that take a single input argument (e.g., `sin()`) are available as
+      zero-argument jq functions.  C math functions that take two input
+      arguments (e.g., `pow()`) are available as two-argument jq
+      functions that ignore `.`.
+
+      Availability of standard math functions depends on the
+      availability of the corresponding math functions in your operating
+      system and C math library.  Unavailable math functions will be
+      defined but will raise an error.
+
   - title: 'I/O'
     body: |