Created
March 16, 2014 23:05
-
-
Save tbielawa/9591150 to your computer and use it in GitHub Desktop.
bitmath converts almost anything https://github.com/tbielawa/bitmath More information: https://blog.lnx.cx/?p=521
This file contains hidden or 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
>>> from bitmath import * | |
>>> four_mibibits = Mib(4) | |
>>> four_mibibits.to_kB() | |
kB(524.288) | |
>>> ninty_nine_bits = Bit(99) | |
>>> a_small_exbibyte = ninty_nine_bits.to_EiB() | |
>>> print "This might as well be zero: %s" % a_small_exbibyte | |
This might as well be zero: 1.07336015076e-17EiB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment