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.2k
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
5
2k
Parsing Javascript
brn
12
6.8k
JSON & Object Tips
brn
1
280
CA 1Day Youth Bootcamp for Frontend LT
brn
0
660
Modern TypeScript
brn
2
670
javascript - behind the scene
brn
3
590
tc39 proposals
brn
0
630
プロダクト開発とTypeScript
brn
8
2.7k
React-Springでリッチなアニメーション
brn
1
480
Other Decks in Programming
See All in Programming
Laravel標準バリデーションでできること
hmb_ok
1
330
MySQL のインデックスの種類をおさらいしよう! / overviewing indexes in MySQL
okashoi
0
160
Cloud RunとCloud PubSubでサーバレスなデータ基盤2024 with Terraform / Cloud Run and PubSub with Terraform
shinyorke
7
1.7k
使えるマークダウンライブラリを探した結果 RailsアプリケーションからRustを使うことになった話
fursich
0
150
OpCode目線で眺める PHPコードのカバレッジ
o0h
PRO
2
470
Kotlinを用いたDSL的な設計手法と使用上の注意
kohii00
2
490
「Hono遍歴」と「HonoXでブログ作成」
yasu551
0
170
Laravel OpenAPIによる"辛くない"スキーマ駆動開発
kentaroutakeda
2
1.5k
架空のコンペ_スクワットフォーム判別コンペの解法
cpptake
0
430
Static Analysis Automation for Hunting Vulnerable Kernel Drivers
takahiro_haruyama
1
1.4k
人口ダッシュボード作成講座資料
jo76shin
0
170
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
830
Featured
See All Featured
How GitHub Uses GitHub to Build GitHub
holman
467
290k
10 Git Anti Patterns You Should be Aware of
lemiorhan
644
57k
Git: the NoSQL Database
bkeepers
PRO
421
63k
Agile that works and the tools we love
rasmusluckow
323
20k
Docker and Python
trallard
33
2.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
225
51k
How To Stay Up To Date on Web Technology
chriscoyier
781
250k
Product Roadmaps are Hard
iamctodd
43
9.6k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Building an army of robots
kneath
300
41k
GraphQLとの向き合い方2022年版
quramy
28
12k
Large-scale JavaScript Application Architecture
addyosmani
501
110k
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!
׀幠耮ָ֮הֲ׀ְׂת׃