剰余演算の定数倍

剰余演算の定数倍
\(\beta\ne0\)とする。

(1)

\[ \frac{1}{\gamma}\mod\left(\alpha,\beta\right)=\mod\left(\frac{\alpha}{\gamma},\frac{\beta}{\gamma}\right) \]

(2)

\[ \frac{1}{\delta}\mod\left(\alpha,\beta,\gamma\right)=\mod\left(\frac{\alpha}{\delta},\frac{\beta}{\delta},\frac{\gamma}{\delta}\right) \]

(3)

\[ \mod\left(\alpha,\beta,\gamma\right)=\sgn\left(\beta\right)\mod\left(\alpha\sgn\left(\beta\right),\left|\beta\right|,\gamma\sgn\left(\beta\right)\right) \]

-

\(\mod\left(\alpha,\beta\right)\)は剰余演算
\(\left\lfloor z\right\rfloor \)は床関数
\(\sgn\left(z\right)\)は符号関数

(1)

\begin{align*} \frac{1}{\gamma}\mod\left(\alpha,\beta\right) & =\frac{\beta}{\gamma}\left(\frac{\alpha}{\beta}-\left\lfloor \frac{\alpha}{\beta}\right\rfloor \right)\\ & =\frac{\beta}{\gamma}\left(\frac{\alpha/\gamma}{\beta/\gamma}-\left\lfloor \frac{\alpha/\gamma}{\beta/\gamma}\right\rfloor \right)\\ & =\mod\left(\frac{\alpha}{\gamma},\frac{\beta}{\gamma}\right) \end{align*}

(2)

\begin{align*} \frac{1}{\delta}\mod\left(\alpha,\beta,\gamma\right) & =\frac{1}{d}\left(\mod\left(\alpha-\gamma,\beta\right)+\gamma\right)\\ & =\mod\left(\frac{\alpha-\gamma}{\delta},\frac{\beta}{\delta}\right)+\frac{\gamma}{\delta}\\ & =\mod\left(\frac{\alpha}{\delta},\frac{\beta}{\delta},\frac{\gamma}{\delta}\right) \end{align*}

(3)

\begin{align*} \mod\left(\alpha,\beta,\gamma\right) & =\sgn\left(\beta\right)\mod\left(\frac{\alpha}{\sgn\left(\beta\right)},\left|\beta\right|,\frac{\gamma}{\sgn\left(\beta\right)}\right)\\ & =\sgn\left(\beta\right)\mod\left(\alpha\sgn\left(\beta\right),\left|\beta\right|,\gamma\sgn\left(\beta\right)\right) \end{align*}

ページ情報
タイトル
剰余演算の定数倍
URL
https://www.nomuramath.com/td3q44u7/
SNSボタン