Weil Jimmer's BlogWeil Jimmer's Blog


關於小數的進位法 10進位轉2進位、2進位轉10進位。

No Comments
-
更新於 2017-05-24 17:03:16

這個問題真的很難處理很難處理!然而網路上也是Google 很久才有的資料。

好吧進入正題。

首先,大家應該都知道,進位算法就是取餘數,但是小數的算法卻是 乘 起來,取整。

Example:

*****0.625 轉 2進位制:

第1式:0.625 × 2 = 1.250 =======>1

第2式:0.250 × 2 = 0.500 =======>0

第3式:0.500 × 2 = 1.000 =======>1

答案是:101

*****0.125 轉 2進位制:

第1式:0.125 × 2 = 0.250 =======>0

第2式:0.250 × 2 = 0.500 =======>0

第3式:0.500 × 2 = 1.000 =======>1

答案是:001

*****0.3 轉 2進位制:

第1式:0.3 × 2 = 0.6 =======>0

第2式:0.6 × 2 = 1.2 =======>1

第3式:0.2 × 2 = 0.4 =======>0

第4式:0.4 × 2 = 0.8 =======>0

第5式:0.8 × 2 = 1.6 =======>1

第5式 偵測到重複字串,造成循環無限小數。

由第2式開始循環字串。

答案是:01001

這樣大概就夠了,這是 10 轉 2 的方式,其他就以此類推。

但是網路上很少有提到!轉回來。只有轉過去。

123.45 = 1 × 102 + 2 × 101 + 3 × 100 + 4 × 10-1 + 5 × 10-2

所以,小數點後,如果是2進位,則是2-1、2-2、2-3 ‧‧‧‧‧‧‧以此類推。

真是難處理,尤其是無限小數的轉換。

所以,我原本也想做一個很棒的程式,但看樣子,我也許得放棄了。

因為有夠麻煩!我目前的程式因為 算的精度太高了,所以無法處理無限小數的問題。

我大概 應該還會繼續完成的樣子,只是需要時間思考。


This entry was posted in Functions By Weil Jimmer.

本站的水印圖

No Comments
-
更新於 2016-03-20 10:09:31


This entry was posted in General By Weil Jimmer.

VB.net 參數

No Comments
-
更新於 2016-02-27 16:49:04

My.Application.CommandLineArgs.Count    '參數總數
My.Application.CommandLineArgs(數字)    '取得參數

作為筆記,以後方便自己記憶。

Example:

cmd-> x:\123.exe 123

code:My.Application.CommandLineArgs(0)

print:123

cmd-> x:\123.exe 123 456

code:My.Application.CommandLineArgs(0)、My.Application.CommandLineArgs(1)

print:123、456


This entry was posted in General By Weil Jimmer.

下載 youtube影片的好用工具

No Comments
-
發布於 2013-12-28 15:09:41

網址:http://www.youtubedownloaderhd.com/


This entry was posted in General By Weil Jimmer.

推薦的免費播放影音軟體 播放器

No Comments
-
發布於 2013-12-27 21:33:52

VLC:http://www.videolan.org/vlc/

GOM:http://www.gomlab.com/tw/


This entry was posted in General By Weil Jimmer.

最前頁 上一頁  14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 /28 頁)下一頁 最終頁

Visitor Count

pop
nonenonenone

Note

台灣假新聞橫行,沒一家霉體能信的,網軍側翼到處洗風向,堪憂。

政府根本不怕你拿法律當武器,只怕你放下法律拿起武器

不要和愚蠢的人發生爭執。

支持網路中立性.
Support Net Neutrality.

飽暖思淫欲,
饑寒起盜心。

朱門酒肉臭,
路有凍死骨。

支持臺灣實施
無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Blogging Journey

4523days

since our first blog post.

Quotes

The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Without music life would be a mistake.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (52)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (61)

Git (2)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (33)

Office (1)

OpenWrt (6)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (26)

Tools (16)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)