七進制是以7為底數的記數系統。使用數字0-6。
基本介紹
表示,乘除加減法表,加法運算,數制轉換,好處,
表示
十進制 | 七進制 (循環部分) |
1/2 | 1/2 = 0.3... |
1/3 | 1/3 = 0.2... |
1/4 | 1/4 = 0.15... |
1/5 | 1/5 = 0.1254... |
1/6 | 1/6 = 0.1... |
1/7 | 1/10 = 0.1 |
1/8 | 1/11 = 0.06... |
1/9 | 1/12 = 0.053... |
1/10 | 1/13 = 0.0462... |
1/12 | 1/15 = 0.04... |
1/14 | 1/20 = 0.03... |
1/15 | 1/21 = 0.0316... |
1/16 | 1/22 = 0.03... |
1/18 | 1/24 = 0.025... |
1/19 | 1/25 = 0.024... |
1/20 | 1/26 = 0.0231... |
1/21 | 1/30 = 0.02... |
1/24 | 1/33 = 0.02... |
... | ... |
1/49 | 1/100 = 0.01 |
乘除加減法表
七進制的乘法表:
* | 1 | 2 | 3 | 4 | 5 | 6 |
1 | 1 | 2 | 3 | 4 | 5 | 6 |
2 | 2 | 4 | 6 | 11 | 13 | 15 |
3 | 3 | 6 | 12 | 15 | 21 | 24 |
4 | 4 | 11 | 15 | 22 | 26 | 33 |
5 | 5 | 13 | 21 | 26 | 34 | 42 |
6 | 6 | 15 | 24 | 33 | 42 | 51 |
七進制的除法表:
/ | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
0 | 無 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 無 | 1 | 4 | 5 | 2 | 3 | 6 |
2 | 無 | 2 | 1 | 3 | 4 | 6 | 5 |
3 | 無 | 3 | 5 | 1 | 6 | 2 | 4 |
4 | 無 | 4 | 2 | 6 | 1 | 5 | 3 |
5 | 無 | 5 | 6 | 4 | 3 | 1 | 2 |
6 | 無 | 6 | 3 | 2 | 5 | 4 | 1 |
七進制的加法表:
+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
1 | 1 | 2 | 3 | 4 | 5 | 6 | 0 |
2 | 2 | 3 | 4 | 5 | 6 | 0 | 1 |
3 | 3 | 4 | 5 | 6 | 0 | 1 | 2 |
4 | 4 | 5 | 6 | 0 | 1 | 2 | 3 |
5 | 5 | 6 | 0 | 1 | 2 | 3 | 4 |
6 | 6 | 0 | 1 | 2 | 3 | 4 | 5 |
七進制的減法表:
- | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
0 | 0 | 6 | 5 | 4 | 3 | 2 | 1 |
1 | 1 | 0 | 6 | 5 | 4 | 3 | 2 |
2 | 2 | 1 | 0 | 6 | 5 | 4 | 3 |
3 | 3 | 2 | 1 | 0 | 6 | 5 | 4 |
4 | 4 | 3 | 2 | 1 | 0 | 6 | 5 |
5 | 5 | 4 | 3 | 2 | 1 | 0 | 6 |
6 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
在七進制中: π = 3.0663651432... e = 2.5012410654...
加法運算
1、131+245=406
2、406+666=1405
3、1405+3456=5164
數制轉換
1、十進制的131轉化成七進制數
131(十)=18*7+5=(2*7+4)*7+5=2*7^2+4*7^1+5=245(七)
2、七進制數245轉化成十進制數
245(七)=2*7^2+4*7^1+5=2*49+4*7+5=98+28+5=131(十)
好處
七進制的一個好處是,3.1 (22/7)是圓周率的一個很好的近似值。
————————————————————————
Function Cvn10to7(num As Long) As Long
Dim rst As Variant
Do While Int(num / 7) <> 0
rst = (num Mod 7) & rst
num = (num - (num Mod 7)) / 7
Loop
Cvn10to7 = num & rst
End Function