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
3k
Parsing Javascript
brn
13
9.1k
JSON & Object Tips
brn
1
440
CA 1Day Youth Bootcamp for Frontend LT
brn
0
870
Modern TypeScript
brn
2
770
javascript - behind the scene
brn
3
710
tc39 proposals
brn
0
830
プロダクト開発とTypeScript
brn
8
2.9k
React-Springでリッチなアニメーション
brn
1
650
Other Decks in Programming
See All in Programming
color-scheme: light dark; を完全に理解する
uhyo
7
480
Better Code Design in PHP
afilina
0
140
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
210
『品質』という言葉が嫌いな理由
korimu
0
180
Open source software: how to live long and go far
gaelvaroquaux
0
650
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
240
楽しく向き合う例外対応
okutsu
0
570
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
410
ARA Ansible for the teams
kksat
0
170
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
130
Generating OpenAPI schema from serializers throughout the Rails stack - Kyobashi.rb #5
envek
1
320
Introduction to kotlinx.rpc
arawn
0
750
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
65k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.4k
What's in a price? How to price your products and services
michaelherold
244
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Embracing the Ebb and Flow
colly
84
4.6k
Typedesign – Prime Four
hannesfritz
40
2.5k
A Philosophy of Restraint
colly
203
16k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
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!
׀幠耮ָ֮הֲ׀ְׂת׃