Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Numbers in javascript
Taketoshi Aono(青野健利 a.k.a brn)
February 26, 2018
Programming
1
4.6k
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)
CA 1Day Youth Bootcamp for Frontend LT
brn
0
360
Modern TypeScript
brn
2
570
javascript - behind the scene
brn
3
500
tc39 proposals
brn
0
520
プロダクト開発とTypeScript
brn
8
2.5k
React-Springでリッチなアニメーション
brn
1
440
javascript internationalization API
brn
0
550
How V8 executes WASM
brn
3
1.4k
memory_in_javascript.pdf
brn
0
710
Other Decks in Programming
See All in Programming
Azure Functionsをサクッと開発、サクッとデプロイ/vscodeconf2023-baba
nina01
1
350
T3 Stack and TypeScript ecosystem
quramy
3
780
domain層のモジュール化 / MoT TechTalk #15
mot_techtalk
0
130
良質な技術記事を量産する秘訣 / #MeetsPro
jnchito
16
4.4k
Spring BootとKubernetesで実現する今どきのDevOps入門
xblood
0
390
データドリブンな組織の不正検知
fkubota
0
290
jq at the Shortcuts
cockscomb
1
440
CDKでValidationする本当の方法 / cdk-validation
gotok365
1
220
Step Functions Distributed Map を使ってみた
codemountains
0
110
SwiftPMのPlugin入門 / introduction_to_swiftpm_plugin
uhooi
2
110
Most Valuable Bug(?) ~インシデント未遂から得た学び~
tatsumiakahori
0
150
Gradle build: The time is now
nonews
1
490
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
13
1.1k
What’s in a name? Adding method to the madness
productmarketing
12
1.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
6
840
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
44
14k
Music & Morning Musume
bryan
37
4.6k
Writing Fast Ruby
sferik
613
58k
Done Done
chrislema
178
14k
A designer walks into a library…
pauljervisheath
199
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
43k
Optimizing for Happiness
mojombo
365
64k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
120
29k
Imperfection Machines: The Place of Print at Facebook
scottboms
254
12k
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!
׀幠耮ָ֮הֲ׀ְׂת׃