Index finite lists of positive integers: Difference between revisions

→‎{{header|jq}}: C implementation limits
m (→‎jq: clarify)
(→‎{{header|jq}}: C implementation limits)
Line 568:
 
=={{header|jq}}==
{{works'''Works with|jq}} gojq''
 
'''Works with gojq'''
'''Works with jq''' within the limits of jq's support for large integer arithmetic
 
'''Works with jaq within the limits of jaq's support for large integers'''
Line 587 ⟶ 588:
For example: 1 2 3 => 11 011 0011 => 110110011 => 110011011 => 10011011
 
The Go implementation of jq supports indefinitely large integers and so, asapart offrom versionmachine 1.6limitations, the Cprograms shown here should work without further qualification using gojq.
 
The C implementation bothof jq, as of version 1.6, supportsupports arbitrarily large literal integers, and
the `tonumber` filter retains precision allowing seamless translation between strings and numbers.
translation between strings and numbers. Thus, apart from machine limitations, the programs shown here should work for arbitrary positive integers, when used with these implementations of jq.
For this reason, in the Fibonacci-based approach, the encoded bitstring is not converted to a decimal number.
 
The following is slightly more verbose than it need be but for the sake of compatibility with jaq. Also note that trivial
2,461

edits