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
Tadpole operators
Search
taiseiue
May 24, 2024
Programming
97
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tadpole operators
taiseiue
May 24, 2024
Transcript
5 slides
Tadpole operators ⾮変インクリメント/デクリメント
Tadpole Operators†とは? • 副作⽤を起こさないインクリメント/デクリメントのこと • ⽇本語では⾮変インクリメント / ⾮変デクリメント • ⾒た⽬からtadpole(おたまじゃくし)演算⼦とも
値が書きかわらない 演算⼦ 同じ意味の式 意味 -~x X + 1 Xに向かって値が⼊って いくイメージ ~-x X - 1 Xから値が出ていく イメージ †https://devblogs.microsoft.com/oldnewthing/20150525-00/?p=45044
Tadpole Operators:利点 • 単項演算⼦なので優先順位が⾼い • (x + 1) * (x
- 1) なら -~x * ~-x と書ける • インクリメント/デクリメントと違い副作⽤がない
ネタバラシ シンキングタイムいる?
ネタバラシ • 本当は`~`(ビット反転)と`-`(符号反転)の組み合わせ • かっこで整理すると ‒(~x)、~(-x)に -(~x) == x+1 ~x
+ 1 == -x を常に満たす x + ~x + 1 == 0 X=5 0101 0011 Y=~X +1010 1100 Z=X+Y 1111 1111 α=Z+1 + 1 β 1 0000 0000 ビット 反転 移項 β α
More Decks by taiseiue
See All by taiseiue
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
160
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
300
RustでもVJしたい!
taiseiue
0
120
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
640
Kotlinのデフォルト引数の話
taiseiue
0
130
.NETの上でお手製の言語を動かす技術
taiseiue
0
130
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
500
振り向き美人
taiseiue
0
50
(自作の)プログラミング言語ができるまで
taiseiue
1
710
Other Decks in Programming
See All in Programming
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
230
Seven New Principles of Software Engineering
yegor256
0
490
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
140
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.5k
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.1k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
SODA - FACT BOOK(JP)
sodainc
1
40k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Side Projects
sachag
456
43k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
480
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
Color Theory Basics | Prateek | Gurzu
gurzu
1
520
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
470
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Un-Boring Meetings
codingconduct
0
490
Making Projects Easy
brettharned
120
6.9k