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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
140
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
280
RustでもVJしたい!
taiseiue
0
110
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
600
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
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
GraphQL の onError と Nullability のこれから
quramy
0
170
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
340
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.3k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
890
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
Event is what happens
moro
2
1.2k
sbt 2.0: takeoff
eed3si9n
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Product Roadmaps are Hard
iamctodd
55
13k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
530
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
GraphQLとの向き合い方2022年版
quramy
50
15k
Side Projects
sachag
456
43k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
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 ビット 反転 移項 β α