We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I contribute?
For instance, I would like to add this to the networking page (number of addresses in subnet):
def number_addresses_from_cidr(cidr): n = 0 if cidr > 0 and cidr < 33: n = 2**(32 - cidr) return n
I don't see any unit tests. It might look something like this:
def test_number_of_addresses_from_cidr(): assert number_addresses_from_cidr(1) == 2147483648 # 2^31 assert number_addresses_from_cidr(2) == 1073741824 # 2^30 assert number_addresses_from_cidr(29) == 8 # 2^3 assert number_addresses_from_cidr(30) == 4 # 2^2 assert number_addresses_from_cidr(31) == 2 # 2^1 assert number_addresses_from_cidr(32) == 1 # 2^0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How can I contribute?
For instance, I would like to add this to the networking page (number of addresses in subnet):
I don't see any unit tests. It might look something like this:
The text was updated successfully, but these errors were encountered: