Index finite lists of positive integers: Difference between revisions
Index finite lists of positive integers (view source)
Revision as of 04:42, 31 January 2024
, 3 months ago→{{header|jq}}: (currently)
m (→{{header|jq}}: (currently)) |
|||
Line 587:
For example: 1 2 3 => 11 011 0011 => 110110011 => 110011011
The Go
implementation both support arbitrarily large literal integers, and
the `tonumber` filter retains precision allowing seamless
Line 596:
The following is slightly more verbose than it need be but for
the sake of compatibility with jaq. Also note that trivial
changes would be required if using jaq as jaq does not (as of this writing in 2024) support
the `include` or `module` directives.
<syntaxhighlight lang="jq">
include "fibonacci" {search: "./"}; # see https://rosettacode.org/wiki/Category:Jq/fibonacci.jq
# Input: an array of integers
# Output: an integer-valued binary string, being the reverse of the concatenated Fibonacci-encoded values
|