Bitwise operations: Difference between revisions
m
→{{header|jq}}: Go
m (→{{header|jq}}: Go) |
|||
(One intermediate revision by the same user not shown) | |||
Line 3,905:
'''Works with jq, the C implementation of jq'''
'''Works with gojq, the
jq has no built-in bitwise operations, but the
[
defines
all those needed for the task at hand except for rotations.
Line 3,930:
def task($x; $y):
def isInteger: type == "number" and . == round;
if ($x|isInteger|not) or ($y|isInteger|not) or
$x < 0 or $y < 0 or $x > 4294967295 or $y > 4294967295
then "Operands must be in the range of a 32-bit unsigned integer" | error
else
|