LoginSignup
1
1

ちいさな計算 python: docker(120)

Last updated at Posted at 2019-03-28

python使って2進数計算などしてみた。

<この項は書きかけです。順次追記します。>

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print("2^8=2*2*2*2*2*2*2*2")
print(2*2*2*2*2*2*2*2)
print("2^16=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2")
print(2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2)
print("2^32=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2")
print(2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2)
print("2^64=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2")
print(2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2)
print("MAC address:2^48=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2")
print(2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2)
print("private address class A = 254*254*254")
print(254*254*254)
print("private address class B = 16*254*254")
print(16*254*254)
print("private address class C = 16*254*254")
print(254*254)
print("Private address class A * B * C= 1254*254*254*16*254*254*254*254")
print(254*254*254*16*254*254*254*254)

実行する

# ./cal.py
2^8=2*2*2*2*2*2*2*2
256
2^16=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2
65536
2^32=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2
4294967296
2^64=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2
18446744073709551616
MAC address:2^48=2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2
281474976710656
private address class A = 254*254*254
16387064
private address class B = 16*254*254
1032256
private address class C = 16*254*254
64516
Private address class A * B * C= 1254*254*254*16*254*254*254*254
1091329761618950144

log計算してみる。

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print("math.log10(1.64)")
print(math.log10(1.64))
print("10*math.log10(1.64)")
print(10* math.log10(1.64))

実行する

# ./log.py
math.log10(1.64)
0.21484384804769785
10*math.log10(1.64)
2.1484384804769787
docker run -it kaizen_japan/wireless /bin/bash

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1