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
84
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
RustでもVJしたい!
taiseiue
0
70
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
420
Kotlinのデフォルト引数の話
taiseiue
0
100
.NETの上でお手製の言語を動かす技術
taiseiue
0
110
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
460
振り向き美人
taiseiue
0
36
(自作の)プログラミング言語ができるまで
taiseiue
1
650
Other Decks in Programming
See All in Programming
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
180
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
190
Claude Team Plan導入・ガイド
tk3fftk
0
240
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
360
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
480
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
420
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
230
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.4k
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
350
What's New in Android 2026
veronikapj
0
210
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
150
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
210
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
4M
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
760
KATA
mclloyd
PRO
35
15k
Side Projects
sachag
455
43k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
The Pragmatic Product Professional
lauravandoore
37
7.4k
RailsConf 2023
tenderlove
30
1.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Exploring anti-patterns in Rails
aemeredith
3
450
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 ビット 反転 移項 β α