title | slug | tags | author | created | |
---|---|---|---|---|---|
Wireguardifying crappy work VPN |
wireguardifying-crappy-work-vpn |
|
Daniel |
2021-06-28 13:20:20 -0700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simplest: round up using math.ceil | |
math.ceil(11 / 3) | |
# using integer division | |
result = 11 // 3 | |
if result * 3 != 11: # or 11 % 3 != 0 or 11 % 3 > 0 | |
result += 1 | |
# smartass way 🙃 equivalent to the above | |
11 // 3 + (11 % 3 > 0) |
NewerOlder