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
Tadpole operators
Search
taiseiue
May 24, 2024
Programming
86
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tadpole operators
taiseiue
May 24, 2024
More Decks by taiseiue
See All by taiseiue
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
120
RustでもVJしたい!
taiseiue
0
75
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
430
Kotlinのデフォルト引数の話
taiseiue
0
110
.NETの上でお手製の言語を動かす技術
taiseiue
0
120
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
470
振り向き美人
taiseiue
0
37
(自作の)プログラミング言語ができるまで
taiseiue
1
670
Other Decks in Programming
See All in Programming
仕様駆動開発の消費期限
watany
20
8.8k
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
580
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
240
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
240
What's New in Android 2026
veronikapj
0
270
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
230
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
270
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.9k
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
VibeCodingからAgenticWorkflowへ
starfish719
0
750
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Paper Plane
katiecoart
PRO
2
53k
So, you think you're a good person
axbom
PRO
2
2.1k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
Thoughts on Productivity
jonyablonski
76
5.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
360
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Transcript
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 ビット 反転 移項 β α