| [976] | 1 | ###
|
|---|
| 2 | ### Binary Unit Conversions
|
|---|
| 3 | ###
|
|---|
| 4 | ### --PLB 3/21/2003
|
|---|
| 5 | ###
|
|---|
| 6 |
|
|---|
| 7 | ##
|
|---|
| 8 | ## http://physics.nist.gov/cuu/Units/binary.html
|
|---|
| 9 | ##
|
|---|
| 10 | ## Factor Name Symbol Origin Derivation
|
|---|
| 11 | ## ------ ---- ------ ------------------- -------------
|
|---|
| 12 | ## 2^10 kibi Ki kilobinary: (2^10)1 kilo: (10^3)1
|
|---|
| 13 | ## 2^20 mebi Mi megabinary: (2^10)2 mega: (10^3)2
|
|---|
| 14 | ## 2^30 gibi Gi gigabinary: (2^10)3 giga: (10^3)3
|
|---|
| 15 | ## 2^40 tebi Ti terabinary: (2^10)4 tera: (10^3)4
|
|---|
| 16 | ## 2^50 pebi Pi petabinary: (2^10)5 peta: (10^3)5
|
|---|
| 17 | ## 2^60 exbi Ei exabinary: (2^10)6 exa: (10^3)
|
|---|
| 18 | ##
|
|---|
| 19 |
|
|---|
| 20 | ##
|
|---|
| 21 | ## Bit Conversions
|
|---|
| 22 | ##
|
|---|
| 23 | def bits_to_bits(n):
|
|---|
| 24 | return n
|
|---|
| 25 |
|
|---|
| 26 | def bits_to_bytes(n):
|
|---|
| 27 | return n / 8.0
|
|---|
| 28 |
|
|---|
| 29 | def bits_to_kibibytes(n):
|
|---|
| 30 | return n / 8192.0
|
|---|
| 31 |
|
|---|
| 32 | def bits_to_kilobytes(n):
|
|---|
| 33 | return n / 8000.0
|
|---|
| 34 |
|
|---|
| 35 | def bits_to_mebibytes(n):
|
|---|
| 36 | return n / 8388608.0
|
|---|
| 37 |
|
|---|
| 38 | def bits_to_megabytes(n):
|
|---|
| 39 | return n / 8000000.0
|
|---|
| 40 |
|
|---|
| 41 | def bits_to_gibibytes(n):
|
|---|
| 42 | return n / 8589934592.0
|
|---|
| 43 |
|
|---|
| 44 | def bits_to_gigabytes(n):
|
|---|
| 45 | return n / 8000000000.0
|
|---|
| 46 |
|
|---|
| 47 | def bits_to_tebibytes(n):
|
|---|
| 48 | return n / 8796093022208.0
|
|---|
| 49 |
|
|---|
| 50 | def bits_to_terabytes(n):
|
|---|
| 51 | return n / 8000000000000.0
|
|---|
| 52 |
|
|---|
| 53 | def bits_to_pebibytes(n):
|
|---|
| 54 | return n / 9007199254740992.0
|
|---|
| 55 |
|
|---|
| 56 | def bits_to_petabytes(n):
|
|---|
| 57 | return n / 8000000000000000.0
|
|---|
| 58 |
|
|---|
| 59 | def bits_to_exbibytes(n):
|
|---|
| 60 | return n / 9223372036854775808.0
|
|---|
| 61 |
|
|---|
| 62 | def bits_to_exabytes(n):
|
|---|
| 63 | return n / 8000000000000000000.0
|
|---|
| 64 |
|
|---|
| 65 | ##
|
|---|
| 66 | ## Byte Conversions
|
|---|
| 67 | ##
|
|---|
| 68 | def bytes_to_bits(n):
|
|---|
| 69 | return n * 8.0
|
|---|
| 70 |
|
|---|
| 71 | def bytes_to_bytes(n):
|
|---|
| 72 | return n
|
|---|
| 73 |
|
|---|
| 74 | def bytes_to_kibibytes(n):
|
|---|
| 75 | return n / 1024.0
|
|---|
| 76 |
|
|---|
| 77 | def bytes_to_kilobytes(n):
|
|---|
| 78 | return n / 1000.0
|
|---|
| 79 |
|
|---|
| 80 | def bytes_to_mebibytes(n):
|
|---|
| 81 | return n / 1048576.0
|
|---|
| 82 |
|
|---|
| 83 | def bytes_to_megabytes(n):
|
|---|
| 84 | return n / 1000000.0
|
|---|
| 85 |
|
|---|
| 86 | def bytes_to_gibibytes(n):
|
|---|
| 87 | return n / 1073741824.0
|
|---|
| 88 |
|
|---|
| 89 | def bytes_to_gigabytes(n):
|
|---|
| 90 | return n / 1000000000.0
|
|---|
| 91 |
|
|---|
| 92 | def bytes_to_tebibytes(n):
|
|---|
| 93 | return n / 1099511627776.0
|
|---|
| 94 |
|
|---|
| 95 | def bytes_to_terabytes(n):
|
|---|
| 96 | return n / 1000000000000.0
|
|---|
| 97 |
|
|---|
| 98 | def bytes_to_pebibytes(n):
|
|---|
| 99 | return n / 1125899906842624.0
|
|---|
| 100 |
|
|---|
| 101 | def bytes_to_petabytes(n):
|
|---|
| 102 | return n / 1000000000000000.0
|
|---|
| 103 |
|
|---|
| 104 | def bytes_to_exbibytes(n):
|
|---|
| 105 | return n / 1152921504606846976.0
|
|---|
| 106 |
|
|---|
| 107 | def bytes_to_exabytes(n):
|
|---|
| 108 | return n / 1000000000000000000.0
|
|---|
| 109 |
|
|---|
| 110 | ##
|
|---|
| 111 | ## Kibibyte Conversions
|
|---|
| 112 | ##
|
|---|
| 113 | def kibibytes_to_bits(n):
|
|---|
| 114 | return n * 8192.0
|
|---|
| 115 |
|
|---|
| 116 | def kibibytes_to_bytes(n):
|
|---|
| 117 | return n * 1024.0
|
|---|
| 118 |
|
|---|
| 119 | def kibibytes_to_kibibytes(n):
|
|---|
| 120 | return n
|
|---|
| 121 |
|
|---|
| 122 | def kibibytes_to_kilobytes(n):
|
|---|
| 123 | return bytes_to_kilobytes(kibibytes_to_bytes(n))
|
|---|
| 124 |
|
|---|
| 125 | def kibibytes_to_mebibytes(n):
|
|---|
| 126 | return bytes_to_mebibytes(kibibytes_to_bytes(n))
|
|---|
| 127 |
|
|---|
| 128 | def kibibytes_to_megabytes(n):
|
|---|
| 129 | return bytes_to_megabytes(kibibytes_to_bytes(n))
|
|---|
| 130 |
|
|---|
| 131 | def kibibytes_to_gibibytes(n):
|
|---|
| 132 | return bytes_to_gibibytes(kibibytes_to_bytes(n))
|
|---|
| 133 |
|
|---|
| 134 | def kibibytes_to_gigabytes(n):
|
|---|
| 135 | return bytes_to_gigabytes(kibibytes_to_bytes(n))
|
|---|
| 136 |
|
|---|
| 137 | def kibibytes_to_tebibytes(n):
|
|---|
| 138 | return bytes_to_tebibytes(kibibytes_to_bytes(n))
|
|---|
| 139 |
|
|---|
| 140 | def kibibytes_to_terabytes(n):
|
|---|
| 141 | return bytes_to_terabytes(kibibytes_to_bytes(n))
|
|---|
| 142 |
|
|---|
| 143 | def kibibytes_to_pebibytes(n):
|
|---|
| 144 | return bytes_to_pebibytes(kibibytes_to_bytes(n))
|
|---|
| 145 |
|
|---|
| 146 | def kibibytes_to_petabytes(n):
|
|---|
| 147 | return bytes_to_petabytes(kibibytes_to_bytes(n))
|
|---|
| 148 |
|
|---|
| 149 | def kibibytes_to_exbibytes(n):
|
|---|
| 150 | return bytes_to_exbibytes(kibibytes_to_bytes(n))
|
|---|
| 151 |
|
|---|
| 152 | def kibibytes_to_exabytes(n):
|
|---|
| 153 | return bytes_to_exabytes(kibibytes_to_bytes(n))
|
|---|
| 154 |
|
|---|
| 155 | ##
|
|---|
| 156 | ## Kilobyte Conversions
|
|---|
| 157 | ##
|
|---|
| 158 |
|
|---|
| 159 | def kilobytes_to_bits(n):
|
|---|
| 160 | return n * 8000.0
|
|---|
| 161 |
|
|---|
| 162 | def kilobytes_to_bytes(n):
|
|---|
| 163 | return n * 1000.0
|
|---|
| 164 |
|
|---|
| 165 | def kilobytes_to_kibibytes(n):
|
|---|
| 166 | return bytes_to_kibibytes(kilobytes_to_bytes(n))
|
|---|
| 167 |
|
|---|
| 168 | def kilobytes_to_kilobytes(n):
|
|---|
| 169 | return n
|
|---|
| 170 |
|
|---|
| 171 | def kilobytes_to_mebibytes(n):
|
|---|
| 172 | return bytes_to_mebibytes(kilobytes_to_bytes(n))
|
|---|
| 173 |
|
|---|
| 174 | def kilobytes_to_megabytes(n):
|
|---|
| 175 | return bytes_to_megabytes(kilobytes_to_bytes(n))
|
|---|
| 176 |
|
|---|
| 177 | def kilobytes_to_gibibytes(n):
|
|---|
| 178 | return bytes_to_gibibytes(kilobytes_to_bytes(n))
|
|---|
| 179 |
|
|---|
| 180 | def kilobytes_to_gigabytes(n):
|
|---|
| 181 | return bytes_to_gigabytes(kilobytes_to_bytes(n))
|
|---|
| 182 |
|
|---|
| 183 | def kilobytes_to_tebibytes(n):
|
|---|
| 184 | return bytes_to_tebibytes(kilobytes_to_bytes(n))
|
|---|
| 185 |
|
|---|
| 186 | def kilobytes_to_terabytes(n):
|
|---|
| 187 | return bytes_to_terabytes(kilobytes_to_bytes(n))
|
|---|
| 188 |
|
|---|
| 189 | def kilobytes_to_pebibytes(n):
|
|---|
| 190 | return bytes_to_pebibytes(kilobytes_to_bytes(n))
|
|---|
| 191 |
|
|---|
| 192 | def kilobytes_to_petabytes(n):
|
|---|
| 193 | return bytes_to_petabytes(kilobytes_to_bytes(n))
|
|---|
| 194 |
|
|---|
| 195 | def kilobytes_to_exbibytes(n):
|
|---|
| 196 | return bytes_to_exbibytes(kilobytes_to_bytes(n))
|
|---|
| 197 |
|
|---|
| 198 | def kilobytes_to_exabytes(n):
|
|---|
| 199 | return bytes_to_exabytes(kilobytes_to_bytes(n))
|
|---|
| 200 |
|
|---|
| 201 | ##
|
|---|
| 202 | ## Mebibyte Conversions
|
|---|
| 203 | ##
|
|---|
| 204 | def mebibytes_to_bits(n):
|
|---|
| 205 | return n * 8388608.0
|
|---|
| 206 |
|
|---|
| 207 | def mebibytes_to_bytes(n):
|
|---|
| 208 | return n * 1048576.0
|
|---|
| 209 |
|
|---|
| 210 | def mebibytes_to_kibibytes(n):
|
|---|
| 211 | return bytes_to_kibibytes(mebibytes_to_bytes(n))
|
|---|
| 212 |
|
|---|
| 213 | def mebibytes_to_kilobytes(n):
|
|---|
| 214 | return bytes_to_kilobytes(mebibytes_to_bytes(n))
|
|---|
| 215 |
|
|---|
| 216 | def mebibytes_to_mebibytes(n):
|
|---|
| 217 | return n
|
|---|
| 218 |
|
|---|
| 219 | def mebibytes_to_megabytes(n):
|
|---|
| 220 | return bytes_to_megabytes(mebibytes_to_bytes(n))
|
|---|
| 221 |
|
|---|
| 222 | def mebibytes_to_gibibytes(n):
|
|---|
| 223 | return bytes_to_gibibytes(mebibytes_to_bytes(n))
|
|---|
| 224 |
|
|---|
| 225 | def mebibytes_to_gigabytes(n):
|
|---|
| 226 | return bytes_to_gigabytes(mebibytes_to_bytes(n))
|
|---|
| 227 |
|
|---|
| 228 | def mebibytes_to_tebibytes(n):
|
|---|
| 229 | return bytes_to_tebibytes(mebibytes_to_bytes(n))
|
|---|
| 230 |
|
|---|
| 231 | def mebibytes_to_terabytes(n):
|
|---|
| 232 | return bytes_to_terabytes(mebibytes_to_bytes(n))
|
|---|
| 233 |
|
|---|
| 234 | def mebibytes_to_pebibytes(n):
|
|---|
| 235 | return bytes_to_pebibytes(mebibytes_to_bytes(n))
|
|---|
| 236 |
|
|---|
| 237 | def mebibytes_to_petabytes(n):
|
|---|
| 238 | return bytes_to_petabytes(mebibytes_to_bytes(n))
|
|---|
| 239 |
|
|---|
| 240 | def mebibytes_to_exbibytes(n):
|
|---|
| 241 | return bytes_to_exbibytes(mebibytes_to_bytes(n))
|
|---|
| 242 |
|
|---|
| 243 | def mebibytes_to_exabytes(n):
|
|---|
| 244 | return bytes_to_exabytes(mebibytes_to_bytes(n))
|
|---|
| 245 |
|
|---|
| 246 | ##
|
|---|
| 247 | ## Megabyte Conversions
|
|---|
| 248 | ##
|
|---|
| 249 | def megabytes_to_bits(n):
|
|---|
| 250 | return n * 8000000.0
|
|---|
| 251 |
|
|---|
| 252 | def megabytes_to_bytes(n):
|
|---|
| 253 | return n * 1000000.0
|
|---|
| 254 |
|
|---|
| 255 | def megabytes_to_kibibytes(n):
|
|---|
| 256 | return bytes_to_kibibytes(megabytes_to_bytes(n))
|
|---|
| 257 |
|
|---|
| 258 | def megabytes_to_kilobytes(n):
|
|---|
| 259 | return bytes_to_kilobytes(megabytes_to_bytes(n))
|
|---|
| 260 |
|
|---|
| 261 | def megabytes_to_mebibytes(n):
|
|---|
| 262 | return bytes_to_mebibytes(megabytes_to_bytes(n))
|
|---|
| 263 |
|
|---|
| 264 | def megabytes_to_megabytes(n):
|
|---|
| 265 | return n
|
|---|
| 266 |
|
|---|
| 267 | def megabytes_to_gibibytes(n):
|
|---|
| 268 | return bytes_to_gibibytes(megabytes_to_bytes(n))
|
|---|
| 269 |
|
|---|
| 270 | def megabytes_to_gigabytes(n):
|
|---|
| 271 | return bytes_to_gigabytes(megabytes_to_bytes(n))
|
|---|
| 272 |
|
|---|
| 273 | def megabytes_to_tebibytes(n):
|
|---|
| 274 | return bytes_to_tebibytes(megabytes_to_bytes(n))
|
|---|
| 275 |
|
|---|
| 276 | def megabytes_to_terabytes(n):
|
|---|
| 277 | return bytes_to_terabytes(megabytes_to_bytes(n))
|
|---|
| 278 |
|
|---|
| 279 | def megabytes_to_pebibytes(n):
|
|---|
| 280 | return bytes_to_pebibytes(megabytes_to_bytes(n))
|
|---|
| 281 |
|
|---|
| 282 | def megabytes_to_petabytes(n):
|
|---|
| 283 | return bytes_to_petabytes(megabytes_to_bytes(n))
|
|---|
| 284 |
|
|---|
| 285 | def megabytes_to_exbibytes(n):
|
|---|
| 286 | return bytes_to_exbibytes(megabytes_to_bytes(n))
|
|---|
| 287 |
|
|---|
| 288 | def megabytes_to_exabytes(n):
|
|---|
| 289 | return bytes_to_exabytes(megabytes_to_bytes(n))
|
|---|
| 290 |
|
|---|
| 291 | ##
|
|---|
| 292 | ## Gibibytes Conversions
|
|---|
| 293 | ##
|
|---|
| 294 | def gibibytes_to_bits(n):
|
|---|
| 295 | return n * 8589934592.0
|
|---|
| 296 |
|
|---|
| 297 | def gibibytes_to_bytes(n):
|
|---|
| 298 | return n * 1073741824.0
|
|---|
| 299 |
|
|---|
| 300 | def gibibytes_to_kibibytes(n):
|
|---|
| 301 | return bytes_to_kibibytes(gibibytes_to_bytes(n))
|
|---|
| 302 |
|
|---|
| 303 | def gibibytes_to_kilobytes(n):
|
|---|
| 304 | return bytes_to_kilobytes(gibibytes_to_bytes(n))
|
|---|
| 305 |
|
|---|
| 306 | def gibibytes_to_mebibytes(n):
|
|---|
| 307 | return bytes_to_mebibytes(gibibytes_to_bytes(n))
|
|---|
| 308 |
|
|---|
| 309 | def gibibytes_to_megabytes(n):
|
|---|
| 310 | return bytes_to_megabytes(gibibytes_to_bytes(n))
|
|---|
| 311 |
|
|---|
| 312 | def gibibytes_to_gibibytes(n):
|
|---|
| 313 | return n
|
|---|
| 314 |
|
|---|
| 315 | def gibibytes_to_gigabytes(n):
|
|---|
| 316 | return bytes_to_gigabytes(gibibytes_to_bytes(n))
|
|---|
| 317 |
|
|---|
| 318 | def gibibytes_to_tebibytes(n):
|
|---|
| 319 | return bytes_to_tebibytes(gibibytes_to_bytes(n))
|
|---|
| 320 |
|
|---|
| 321 | def gibibytes_to_terabytes(n):
|
|---|
| 322 | return bytes_to_terabytes(gibibytes_to_bytes(n))
|
|---|
| 323 |
|
|---|
| 324 | def gibibytes_to_pebibytes(n):
|
|---|
| 325 | return bytes_to_pebibytes(gibibytes_to_bytes(n))
|
|---|
| 326 |
|
|---|
| 327 | def gibibytes_to_petabytes(n):
|
|---|
| 328 | return bytes_to_petabytes(gibibytes_to_bytes(n))
|
|---|
| 329 |
|
|---|
| 330 | def gibibytes_to_exbibytes(n):
|
|---|
| 331 | return bytes_to_exbibytes(gibibytes_to_bytes(n))
|
|---|
| 332 |
|
|---|
| 333 | def gibibytes_to_exabytes(n):
|
|---|
| 334 | return bytes_to_exabytes(gibibytes_to_bytes(n))
|
|---|
| 335 |
|
|---|
| 336 | ##
|
|---|
| 337 | ## Gigabyte Conversions
|
|---|
| 338 | ##
|
|---|
| 339 | def gigabytes_to_bits(n):
|
|---|
| 340 | return n * 8000000000.0
|
|---|
| 341 |
|
|---|
| 342 | def gigabytes_to_bytes(n):
|
|---|
| 343 | return n * 1000000000.0
|
|---|
| 344 |
|
|---|
| 345 | def gigabytes_to_kibibytes(n):
|
|---|
| 346 | return bytes_to_kibibytes(gigabytes_to_bytes(n))
|
|---|
| 347 |
|
|---|
| 348 | def gigabytes_to_kilobytes(n):
|
|---|
| 349 | return bytes_to_kilobytes(gigabytes_to_bytes(n))
|
|---|
| 350 |
|
|---|
| 351 | def gigabytes_to_mebibytes(n):
|
|---|
| 352 | return bytes_to_mebibytes(gigabytes_to_bytes(n))
|
|---|
| 353 |
|
|---|
| 354 | def gigabytes_to_megabytes(n):
|
|---|
| 355 | return bytes_to_megabytes(gigabytes_to_bytes(n))
|
|---|
| 356 |
|
|---|
| 357 | def gigabytes_to_gibibytes(n):
|
|---|
| 358 | return bytes_to_gibibytes(gigabytes_to_bytes(n))
|
|---|
| 359 |
|
|---|
| 360 | def gigabytes_to_gigabytes(n):
|
|---|
| 361 | return n
|
|---|
| 362 |
|
|---|
| 363 | def gigabytes_to_tebibytes(n):
|
|---|
| 364 | return bytes_to_tebibytes(gigabytes_to_bytes(n))
|
|---|
| 365 |
|
|---|
| 366 | def gigabytes_to_terabytes(n):
|
|---|
| 367 | return bytes_to_terabytes(gigabytes_to_bytes(n))
|
|---|
| 368 |
|
|---|
| 369 | def gigabytes_to_pebibytes(n):
|
|---|
| 370 | return bytes_to_pebibytes(gigabytes_to_bytes(n))
|
|---|
| 371 |
|
|---|
| 372 | def gigabytes_to_petabytes(n):
|
|---|
| 373 | return bytes_to_petabytes(gigabytes_to_bytes(n))
|
|---|
| 374 |
|
|---|
| 375 | def gigabytes_to_exbibytes(n):
|
|---|
| 376 | return bytes_to_exbibytes(gigabytes_to_bytes(n))
|
|---|
| 377 |
|
|---|
| 378 | def gigabytes_to_exabytes(n):
|
|---|
| 379 | return bytes_to_exabytes(gigabytes_to_bytes(n))
|
|---|
| 380 |
|
|---|
| 381 | ##
|
|---|
| 382 | ## Tebibyte Conversions
|
|---|
| 383 | ##
|
|---|
| 384 | def tebibytes_to_bits(n):
|
|---|
| 385 | return n * 8796093022208.0
|
|---|
| 386 |
|
|---|
| 387 | def tebibytes_to_bytes(n):
|
|---|
| 388 | return n * 1099511627776.0
|
|---|
| 389 |
|
|---|
| 390 | def tebibytes_to_kibibytes(n):
|
|---|
| 391 | return bytes_to_kibibytes(tebibytes_to_bytes(n))
|
|---|
| 392 |
|
|---|
| 393 | def tebibytes_to_kilobytes(n):
|
|---|
| 394 | return bytes_to_kilobytes(tebibytes_to_bytes(n))
|
|---|
| 395 |
|
|---|
| 396 | def tebibytes_to_mebibytes(n):
|
|---|
| 397 | return bytes_to_mebibytes(tebibytes_to_bytes(n))
|
|---|
| 398 |
|
|---|
| 399 | def tebibytes_to_megabytes(n):
|
|---|
| 400 | return bytes_to_megabytes(tebibytes_to_bytes(n))
|
|---|
| 401 |
|
|---|
| 402 | def tebibytes_to_gibibytes(n):
|
|---|
| 403 | return bytes_to_gibibytes(tebibytes_to_bytes(n))
|
|---|
| 404 |
|
|---|
| 405 | def tebibytes_to_gigabytes(n):
|
|---|
| 406 | return bytes_to_gigabytes(tebibytes_to_bytes(n))
|
|---|
| 407 |
|
|---|
| 408 | def tebibytes_to_tebibytes(n):
|
|---|
| 409 | return n
|
|---|
| 410 |
|
|---|
| 411 | def tebibytes_to_terabytes(n):
|
|---|
| 412 | return bytes_to_terabytes(tebibytes_to_bytes(n))
|
|---|
| 413 |
|
|---|
| 414 | def tebibytes_to_pebibytes(n):
|
|---|
| 415 | return bytes_to_pebibytes(tebibytes_to_bytes(n))
|
|---|
| 416 |
|
|---|
| 417 | def tebibytes_to_petabytes(n):
|
|---|
| 418 | return bytes_to_petabytes(tebibytes_to_bytes(n))
|
|---|
| 419 |
|
|---|
| 420 | def tebibytes_to_exbibytes(n):
|
|---|
| 421 | return bytes_to_exbibytes(tebibytes_to_bytes(n))
|
|---|
| 422 |
|
|---|
| 423 | def tebibytes_to_exabytes(n):
|
|---|
| 424 | return bytes_to_exabytes(tebibytes_to_bytes(n))
|
|---|
| 425 |
|
|---|
| 426 | ##
|
|---|
| 427 | ## Terabyte Conversions
|
|---|
| 428 | ##
|
|---|
| 429 | def terabytes_to_bits(n):
|
|---|
| 430 | return n * 8000000000000.0
|
|---|
| 431 |
|
|---|
| 432 | def terabytes_to_bytes(n):
|
|---|
| 433 | return n * 1000000000000.0
|
|---|
| 434 |
|
|---|
| 435 | def terabytes_to_kibibytes(n):
|
|---|
| 436 | return bytes_to_kibibytes(terabytes_to_bytes(n))
|
|---|
| 437 |
|
|---|
| 438 | def terabytes_to_kilobytes(n):
|
|---|
| 439 | return bytes_to_kilobytes(terabytes_to_bytes(n))
|
|---|
| 440 |
|
|---|
| 441 | def terabytes_to_mebibytes(n):
|
|---|
| 442 | return bytes_to_mebibytes(terabytes_to_bytes(n))
|
|---|
| 443 |
|
|---|
| 444 | def terabytes_to_megabytes(n):
|
|---|
| 445 | return bytes_to_megabytes(terabytes_to_bytes(n))
|
|---|
| 446 |
|
|---|
| 447 | def terabytes_to_gibibytes(n):
|
|---|
| 448 | return bytes_to_gibibytes(terabytes_to_bytes(n))
|
|---|
| 449 |
|
|---|
| 450 | def terabytes_to_gigabytes(n):
|
|---|
| 451 | return bytes_to_gigabytes(terabytes_to_bytes(n))
|
|---|
| 452 |
|
|---|
| 453 | def terabytes_to_tebibytes(n):
|
|---|
| 454 | return bytes_to_tebibytes(terabytes_to_bytes(n))
|
|---|
| 455 |
|
|---|
| 456 | def terabytes_to_terabytes(n):
|
|---|
| 457 | return n
|
|---|
| 458 |
|
|---|
| 459 | def terabytes_to_pebibytes(n):
|
|---|
| 460 | return bytes_to_pebibytes(terabytes_to_bytes(n))
|
|---|
| 461 |
|
|---|
| 462 | def terabytes_to_petabytes(n):
|
|---|
| 463 | return bytes_to_petabytes(terabytes_to_bytes(n))
|
|---|
| 464 |
|
|---|
| 465 | def terabytes_to_exbibytes(n):
|
|---|
| 466 | return bytes_to_exbibytes(terabytes_to_bytes(n))
|
|---|
| 467 |
|
|---|
| 468 | def terabytes_to_exabytes(n):
|
|---|
| 469 | return bytes_to_exabytes(terabytes_to_bytes(n))
|
|---|
| 470 |
|
|---|
| 471 | ##
|
|---|
| 472 | ## Pebibyte Conversions
|
|---|
| 473 | ##
|
|---|
| 474 | def pebibytes_to_bits(n):
|
|---|
| 475 | return n * 9007199254740992.0
|
|---|
| 476 |
|
|---|
| 477 | def pebibytes_to_bytes(n):
|
|---|
| 478 | return n * 1125899906842624.0
|
|---|
| 479 |
|
|---|
| 480 | def pebibytes_to_kibibytes(n):
|
|---|
| 481 | return bytes_to_kibibytes(pebibytes_to_bytes(n))
|
|---|
| 482 |
|
|---|
| 483 | def pebibytes_to_kilobytes(n):
|
|---|
| 484 | return bytes_to_kilobytes(pebibytes_to_bytes(n))
|
|---|
| 485 |
|
|---|
| 486 | def pebibytes_to_mebibytes(n):
|
|---|
| 487 | return bytes_to_mebibytes(pebibytes_to_bytes(n))
|
|---|
| 488 |
|
|---|
| 489 | def pebibytes_to_megabytes(n):
|
|---|
| 490 | return bytes_to_megabytes(pebibytes_to_bytes(n))
|
|---|
| 491 |
|
|---|
| 492 | def pebibytes_to_gibibytes(n):
|
|---|
| 493 | return bytes_to_gibibytes(pebibytes_to_bytes(n))
|
|---|
| 494 |
|
|---|
| 495 | def pebibytes_to_gigabytes(n):
|
|---|
| 496 | return bytes_to_gigabytes(pebibytes_to_bytes(n))
|
|---|
| 497 |
|
|---|
| 498 | def pebibytes_to_tebibytes(n):
|
|---|
| 499 | return bytes_to_tebibytes(pebibytes_to_bytes(n))
|
|---|
| 500 |
|
|---|
| 501 | def pebibytes_to_terabytes(n):
|
|---|
| 502 | return bytes_to_terabytes(pebibytes_to_bytes(n))
|
|---|
| 503 |
|
|---|
| 504 | def pebibytes_to_pebibytes(n):
|
|---|
| 505 | return n
|
|---|
| 506 |
|
|---|
| 507 | def pebibytes_to_petabytes(n):
|
|---|
| 508 | return bytes_to_petabytes(pebibytes_to_bytes(n))
|
|---|
| 509 |
|
|---|
| 510 | def pebibytes_to_exbibytes(n):
|
|---|
| 511 | return bytes_to_exbibytes(pebibytes_to_bytes(n))
|
|---|
| 512 |
|
|---|
| 513 | def pebibytes_to_exabytes(n):
|
|---|
| 514 | return bytes_to_exabytes(pebibytes_to_bytes(n))
|
|---|
| 515 |
|
|---|
| 516 | ##
|
|---|
| 517 | ## Petabyte Conversions
|
|---|
| 518 | ##
|
|---|
| 519 | def petabytes_to_bits(n):
|
|---|
| 520 | return n * 8000000000000000.0
|
|---|
| 521 |
|
|---|
| 522 | def petabytes_to_bytes(n):
|
|---|
| 523 | return n * 1000000000000000.0
|
|---|
| 524 |
|
|---|
| 525 | def petabytes_to_kibibytes(n):
|
|---|
| 526 | return bytes_to_kibibytes(petabytes_to_bytes(n))
|
|---|
| 527 |
|
|---|
| 528 | def petabytes_to_kilobytes(n):
|
|---|
| 529 | return bytes_to_kilobytes(petabytes_to_bytes(n))
|
|---|
| 530 |
|
|---|
| 531 | def petabytes_to_mebibytes(n):
|
|---|
| 532 | return bytes_to_mebibytes(petabytes_to_bytes(n))
|
|---|
| 533 |
|
|---|
| 534 | def petabytes_to_megabytes(n):
|
|---|
| 535 | return bytes_to_megabytes(petabytes_to_bytes(n))
|
|---|
| 536 |
|
|---|
| 537 | def petabytes_to_gibibytes(n):
|
|---|
| 538 | return bytes_to_gibibytes(petabytes_to_bytes(n))
|
|---|
| 539 |
|
|---|
| 540 | def petabytes_to_gigabytes(n):
|
|---|
| 541 | return bytes_to_gigabytes(petabytes_to_bytes(n))
|
|---|
| 542 |
|
|---|
| 543 | def petabytes_to_tebibytes(n):
|
|---|
| 544 | return bytes_to_tebibytes(petabytes_to_bytes(n))
|
|---|
| 545 |
|
|---|
| 546 | def petabytes_to_terabytes(n):
|
|---|
| 547 | return bytes_to_terabytes(petabytes_to_bytes(n))
|
|---|
| 548 |
|
|---|
| 549 | def petabytes_to_pebibytes(n):
|
|---|
| 550 | return bytes_to_pebibytes(petabytes_to_bytes(n))
|
|---|
| 551 |
|
|---|
| 552 | def petabytes_to_petabytes(n):
|
|---|
| 553 | return n
|
|---|
| 554 |
|
|---|
| 555 | def petabytes_to_exbibytes(n):
|
|---|
| 556 | return bytes_to_exbibytes(petabytes_to_bytes(n))
|
|---|
| 557 |
|
|---|
| 558 | def petabytes_to_exabytes(n):
|
|---|
| 559 | return bytes_to_exabytes(petabytes_to_bytes(n))
|
|---|
| 560 |
|
|---|
| 561 | ##
|
|---|
| 562 | ## Exbibyte Conversions
|
|---|
| 563 | ##
|
|---|
| 564 | def exbibytes_to_bits(n):
|
|---|
| 565 | return n * 9223372036854775808.0
|
|---|
| 566 |
|
|---|
| 567 | def exbibytes_to_bytes(n):
|
|---|
| 568 | return n * 1152921504606846976.0
|
|---|
| 569 |
|
|---|
| 570 | def exbibytes_to_kibibytes(n):
|
|---|
| 571 | return bytes_to_kibibytes(exbibytes_to_bytes(n))
|
|---|
| 572 |
|
|---|
| 573 | def exbibytes_to_kilobytes(n):
|
|---|
| 574 | return bytes_to_kilobytes(exbibytes_to_bytes(n))
|
|---|
| 575 |
|
|---|
| 576 | def exbibytes_to_mebibytes(n):
|
|---|
| 577 | return bytes_to_mebibytes(exbibytes_to_bytes(n))
|
|---|
| 578 |
|
|---|
| 579 | def exbibytes_to_megabytes(n):
|
|---|
| 580 | return bytes_to_megabytes(exbibytes_to_bytes(n))
|
|---|
| 581 |
|
|---|
| 582 | def exbibytes_to_gibibytes(n):
|
|---|
| 583 | return bytes_to_gibibytes(exbibytes_to_bytes(n))
|
|---|
| 584 |
|
|---|
| 585 | def exbibytes_to_gigabytes(n):
|
|---|
| 586 | return bytes_to_gigabytes(exbibytes_to_bytes(n))
|
|---|
| 587 |
|
|---|
| 588 | def exbibytes_to_tebibytes(n):
|
|---|
| 589 | return bytes_to_tebibytes(exbibytes_to_bytes(n))
|
|---|
| 590 |
|
|---|
| 591 | def exbibytes_to_terabytes(n):
|
|---|
| 592 | return bytes_to_terabytes(exbibytes_to_bytes(n))
|
|---|
| 593 |
|
|---|
| 594 | def exbibytes_to_pebibytes(n):
|
|---|
| 595 | return bytes_to_pebibytes(exbibytes_to_bytes(n))
|
|---|
| 596 |
|
|---|
| 597 | def exbibytes_to_petabytes(n):
|
|---|
| 598 | return bytes_to_petabytes(exbibytes_to_bytes(n))
|
|---|
| 599 |
|
|---|
| 600 | def exbibytes_to_exbibytes(n):
|
|---|
| 601 | return n
|
|---|
| 602 |
|
|---|
| 603 | def exbibytes_to_exabytes(n):
|
|---|
| 604 | return bytes_to_exabytes(exbibytes_to_bytes(n))
|
|---|
| 605 |
|
|---|
| 606 | ##
|
|---|
| 607 | ## Exabyte Conversions
|
|---|
| 608 | ##
|
|---|
| 609 | def exabytes_to_bits(n):
|
|---|
| 610 | return n * 8000000000000000000.0
|
|---|
| 611 |
|
|---|
| 612 | def exabytes_to_bytes(n):
|
|---|
| 613 | return n * 1000000000000000000.0
|
|---|
| 614 |
|
|---|
| 615 | def exabytes_to_kibibytes(n):
|
|---|
| 616 | return bytes_to_kibibytes(exabytes_to_bytes(n))
|
|---|
| 617 |
|
|---|
| 618 | def exabytes_to_kilobytes(n):
|
|---|
| 619 | return bytes_to_kilobytes(exabytes_to_bytes(n))
|
|---|
| 620 |
|
|---|
| 621 | def exabytes_to_mebibytes(n):
|
|---|
| 622 | return bytes_to_mebibytes(exabytes_to_bytes(n))
|
|---|
| 623 |
|
|---|
| 624 | def exabytes_to_megabytes(n):
|
|---|
| 625 | return bytes_to_megabytes(exabytes_to_bytes(n))
|
|---|
| 626 |
|
|---|
| 627 | def exabytes_to_gibibytes(n):
|
|---|
| 628 | return bytes_to_gibibytes(exabytes_to_bytes(n))
|
|---|
| 629 |
|
|---|
| 630 | def exabytes_to_gigabytes(n):
|
|---|
| 631 | return bytes_to_gigabytes(exabytes_to_bytes(n))
|
|---|
| 632 |
|
|---|
| 633 | def exabytes_to_tebibytes(n):
|
|---|
| 634 | return bytes_to_tebibytes(exabytes_to_bytes(n))
|
|---|
| 635 |
|
|---|
| 636 | def exabytes_to_terabytes(n):
|
|---|
| 637 | return bytes_to_terabytes(exabytes_to_bytes(n))
|
|---|
| 638 |
|
|---|
| 639 | def exabytes_to_pebibytes(n):
|
|---|
| 640 | return bytes_to_pebibytes(exabytes_to_bytes(n))
|
|---|
| 641 |
|
|---|
| 642 | def exabytes_to_petabytes(n):
|
|---|
| 643 | return bytes_to_petabytes(exabytes_to_bytes(n))
|
|---|
| 644 |
|
|---|
| 645 | def exabytes_to_exbibytes(n):
|
|---|
| 646 | return bytes_to_exbibytes(exabytes_to_bytes(n))
|
|---|
| 647 |
|
|---|
| 648 | def exabytes_to_exabytes(n):
|
|---|
| 649 | return n
|
|---|