Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Numbers in javascript
Search
Taketoshi Aono(青野健利 a.k.a brn)
February 26, 2018
Programming
1
5.4k
Numbers in javascript
JSのNumberについて
Taketoshi Aono(青野健利 a.k.a brn)
February 26, 2018
Tweet
Share
More Decks by Taketoshi Aono(青野健利 a.k.a brn)
See All by Taketoshi Aono(青野健利 a.k.a brn)
document.write再考
brn
6
2.9k
Parsing Javascript
brn
12
9k
JSON & Object Tips
brn
1
410
CA 1Day Youth Bootcamp for Frontend LT
brn
0
830
Modern TypeScript
brn
2
750
javascript - behind the scene
brn
3
700
tc39 proposals
brn
0
800
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
620
Other Decks in Programming
See All in Programming
fs2-io を試してたらバグを見つけて直した話
chencmd
0
260
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
160
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
300
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
KubeCon NA 2024の全DB関連セッションを紹介
nnaka2992
0
100
MCP with Cloudflare Workers
yusukebe
2
230
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
670
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
590
Zoneless Testing
rainerhahnekamp
0
130
ドメインイベント増えすぎ問題
h0r15h0
2
480
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
160
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
360
Featured
See All Featured
Producing Creativity
orderedlist
PRO
342
39k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Become a Pro
speakerdeck
PRO
26
5.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Designing for Performance
lara
604
68k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Docker and Python
trallard
43
3.2k
Writing Fast Ruby
sferik
628
61k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
530
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
Numbers in javascript
Name @brn (ꫬꅿ⨳ⵃ) Occupation ؿٗٝزؒٝسؒٝآص،٥ط؎ذ؍ـؒٝآص، Company Cyberagent ،سذؙأةآؔ AI Messenger
OSS Contributor of V8 About http://info.b6n.ch
Number ES2016~2018穗גjavascriptך侧⦼㘗ח ְֻאַ㢌⻉ָ֮ךדך鑧
Variations - 侭侧 - 㼭侧 - 16鹌侧 - 8鹌侧 -
2鹌侧 - Bigint - Separator
侭侧 64bitתדך侭侧䪔ִ ⰻ鿇涸חכ㹋鄲⣛㶷ָ31bit侭侧ה64bit Doubleדⴽגְծ 64bit Doubleך
㼭侧 㼭侧挿 הֻח鎉ֲֿהזְָծⰻ鿇涸חכ64bit DoubleדⳢ椚ׁ זךד鎘皾穠卓כ鵚⡂⦼חז
16鹌侧 0xדכׄת侧⦼ CSSהַדֶזׄ
8鹌侧 0oדכׄתַ 0~ד7⟃♳ך侧⦼ָזְ㜥さח8鹌侧חז ؿ؋؎ٕػ٦ىحءّٝהַדֶזׄ
// 8進数! 0o777! ! // 暗黙の8進数 0777! ! // 0から始まる10進数
0778! ! "use strict";! 0777 // Error!!
2鹌侧 0bַ㨣ת0ה1ך⢪欽〳腉זٔذٕٓ
// 2進数! 0b11101101 // 237!
BigInt 64bit⟃♳ך侧⦼䪔ֲ㜥さח⢪ֲ 植㖈Stage3 侧⦼ٔذٕٓך䖓ח n אֽֿהדBigIntٔذٕٓ邌植ׅկ HexװOctalٔذٕٓ؟ه٦زկ侧⦼ٔذٕٓהずֻׄn劣㽵ח אֽֿהדBigIntחזկ(׃ծOctalכ0oXXX䕎䒭ך) תծtypeof <bigint>כ
'bigint'ָ䨱կ
// Bigint! 10n + 10n // 20n! 10n + 10
// Error! typeof 10n // 'bigint'! BigInt('100') // 100n!
BigInt 鑫׃ֻכ https://speakerdeck.com/brn/ecmascript-bigint ח剅ְ
Separator 植㖈Stage3 תmergeׁגְזְָV8ח㹋鄲׃ג ךֲ⢪ִ״ֲחזծ✮㹀
// Numeric Separators! 1_0_0_0_0! 0xFF_FF_FF! 0b1000_1111_0000! 0o7_7_7! ! 1__0 //
Error! 1000_ // Error!
׀幠耮ָ֮הֲ׀ְׂת׃