# use ip_to_binary() to understand these examples better
# bitwise NOT
!ip_address("192.168.0.1")
# bitwise AND
ip_address("192.168.0.1") & ip_address("255.0.0.255")
# bitwise OR
ip_address("192.168.0.0") | ip_address("255.0.0.255")
# bitwise XOR
ip_address("192.168.0.0") ^ ip_address("255.0.0.255")
# bitwise shift left
ip_address("192.168.0.1") %<<% 1
# bitwise shift right
ip_address("192.168.0.1") %>>% 1
# addition of integers
ip_address("192.168.0.1") + 10
# subtraction of integers
ip_address("192.168.0.1") - 10
Run the code above in your browser using DataLab