<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>natsugiri</author_name>
  <author_url>https://blog.hatena.ne.jp/natsugiri/</author_url>
  <blog_title>でも今日はSRMあるから</blog_title>
  <blog_url>https://natsugiri.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>% を剰余演算子とする。 を2以上の2^31未満の整数とする。 をたくさん求めたいときに、 について前処理をしておけば除算・剰余算を使わずに計算できる場合がある。 とくに、 が定数であるがコンパイル時に決定できない場合に高速化することができる（コンパイル時に決定しているならばそもそも今回の手法と同程度に高速）。 2つの方法 Barrett Reduction と Montgomery Reduction を実装した。 まとめ コード https://ideone.com/sNBQTz 実装は4種: ナイーブな剰余演算子、Montgomery乗算、Barrett Reduction、Barret…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnatsugiri.hatenablog.com%2Fentry%2F2020%2F04%2F06%2F030559&quot; title=&quot;高速なMOD演算 Barrett Reduction, Montgomery 乗算 - でも今日はSRMあるから&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-04-06 03:05:59</published>
  <title>高速なMOD演算 Barrett Reduction, Montgomery 乗算</title>
  <type>rich</type>
  <url>https://natsugiri.hatenablog.com/entry/2020/04/06/030559</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
