Help us understand the problem. What is going on with this article?

ちいさな計算 python

More than 1 year has passed since last update.

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
kaizen_nagoya
I'm a network designer.I work on TOPPERS SmallestSetProfile Kernel,MISRA-C, STARC RTL Design StyleGuide (Verilog-HDL),HAZOP,ISO/IEC15504(AutomotiveSPICE),ISO26262. I was an editor on ISO/IEC 15504.
https://researchmap.jp/blogs/blog_entries/view/81777/f691323917cc4ea12caf0b03b34c8ea0?frame_id=442673
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした