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
93
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
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
280
RustでもVJしたい!
taiseiue
0
110
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
610
Kotlinのデフォルト引数の話
taiseiue
0
120
.NETの上でお手製の言語を動かす技術
taiseiue
0
130
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
490
振り向き美人
taiseiue
0
42
(自作の)プログラミング言語ができるまで
taiseiue
1
700
Other Decks in Programming
See All in Programming
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.1k
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
150
AIに “答え“を書かせるのを やめてみた
___akari11
0
130
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
190
APNsからLive Activityを開始する話
yumnumm
0
170
Simple Storage Service(S3) is not simple
iwatsukayura
0
320
sbt 2.0: takeoff
eed3si9n
0
170
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
840
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
920
オーケストレーション記述言語 Katari
yukikurage
0
190
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Producing Creativity
orderedlist
PRO
348
41k
WCS-LA-2024
lcolladotor
0
900
Abbi's Birthday
coloredviolet
4
10k
Git: the NoSQL Database
bkeepers
PRO
433
67k
How to Ace a Technical Interview
jacobian
280
24k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
740
The Invisible Side of Design
smashingmag
301
52k
Into the Great Unknown - MozCon
thekraken
41
2.8k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
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 ビット 反転 移項 β α