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
0
48
Tadpole operators
taiseiue
May 24, 2024
Tweet
Share
More Decks by taiseiue
See All by taiseiue
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
130
Kotlinのデフォルト引数の話
taiseiue
0
35
.NETの上でお手製の言語を動かす技術
taiseiue
0
57
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
270
振り向き美人
taiseiue
0
15
(自作の)プログラミング言語ができるまで
taiseiue
1
330
Other Decks in Programming
See All in Programming
TSConfigからTypeScriptの世界を覗く
planck16
2
1.3k
生成AI時代のフルスタック開発
kenn
10
2.5k
知識0からカンファレンスやってみたらこうなった!
syossan27
5
320
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
510
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
260
イベントソーシングとAIの親和性ー物語とLLMに理解できるデータ
tomohisa
1
160
型安全なDrag and Dropの設計を考える
yudppp
5
650
AIにコードを生成するコードを作らせて、再現性を担保しよう! / Let AI generate code to ensure reproducibility
yamachu
7
6k
ワイがおすすめする新潟の食 / 20250530phpconf-niigata-eve
kasacchiful
0
180
ドメイン駆動設計とXPで支える子どもの未来 / Domain-Driven Design and XP Supporting Children's Future
nrslib
0
350
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
590
REST API設計の実践 – ベストプラクティスとその落とし穴
kentaroutakeda
2
310
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.4k
Embracing the Ebb and Flow
colly
85
4.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
610
How to train your dragon (web standard)
notwaldorf
92
6k
Facilitating Awesome Meetings
lara
54
6.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building an army of robots
kneath
306
45k
Designing for Performance
lara
608
69k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Become a Pro
speakerdeck
PRO
28
5.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
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 ビット 反転 移項 β α