Luhn test of credit card numbers: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add BQN) |
(→{{header|jq}}: versions) |
||
Line 3,131: | Line 3,131: | ||
=={{header|jq}}== |
=={{header|jq}}== |
||
{{works with|jq|1.4 or later}} |
|||
'''Works with gojq, the Go implementation of jq''' |
|||
For the specific task defined here, both jq (version 1.4 or later) |
|||
and gojq should suffice, but for very large integers (greater than |
|||
2^53), either gojq or a version of the C implementation of jq with |
|||
support for very large external integers would be required. |
|||
<lang jq>def luhn: |
<lang jq>def luhn: |
||
def odds: . as $in | reduce range(0; length) as $i |
def odds: . as $in | reduce range(0; length) as $i |