Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【LT会】進数を学ぼう! / study base number
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
K H
July 05, 2024
29
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【LT会】進数を学ぼう! / study base number
K H
July 05, 2024
More Decks by K H
See All by K H
ファシリテーションテクニック / facilitation technic
kengohayata
0
24
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
37
RailsのQueryオブジェクトとは / What is a Query Object in Rails?
kengohayata
0
37
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
35
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
68
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
78
エンジニア座談会告知
kengohayata
0
80
未経験転職エンジニア座談会資料
kengohayata
0
72
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
460
Being A Developer After 40
akosma
92
590k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Google's AI Overviews - The New Search
badams
0
1.6k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
The Curious Case for Waylosing
cassininazir
1
570
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Transcript
進数を学ぼう!(Ruby の事例)
IPv4アドレスは10進数表記・・・?(192.168.0.1) Rubyの進数表記・・・?(0b1010、0x1A) 進数わからん!!
10進数 • 「0」「1」「2」……「9」「10」のように、それぞ れの桁の数字が「10」になると桁上がりする数字の こと • 「0」から「9」までの組み合わせで表現される数字 • 例:391
2進数 • 「0」と「1」の組み合わせで表現される数字 • 「0」「1」「10」……のように、それぞれの桁の数 字が「2」になると桁上がりする数字のこと • 例:110(10進数では6)
8進数 • 「0」から「7」までの組み合わせで表現される数字 • 「0」「1」...「7」「10」……のように、それぞれの 桁の数字が「8」になると桁上がりする数字のこと • 例:377(10進数では255)
16進数 • 0から9までの数字とAからFまでのアルファベットの 組み合わせで表現される数字 • 「0」「1」「2」……「9」「A」「B」「C」「D」 「E」「F」のように、それぞれの桁の数字が「16」 になると桁上がりする数字のこと • 例:7D(10進数では126)
Ruby で進数に変換してみよう • String#to_i 文字列を引数に指定した2 〜 36の進数表現に変換する • 0b(2進数)0(8進数)0d(10進数)0x(16進数) 数字の接頭辞に指定することで、進数表現に変換する
• 例:0b10 => 2、010 => 8、0d10 => 10、0x10 => 16 • 例:’10’.to_i(8) => 8
進数を完全に理解できた