Bitwise operations: Difference between revisions
→{{header|jq}}: convert external to internal link (for "What links here")
(→{{header|jq}}: convert external to internal link (for "What links here")) |
|||
Line 3,908:
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
|