<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hnw</author_name>
  <author_url>https://blog.hatena.ne.jp/hnw/</author_url>
  <blog_title>hnwの日記</blog_title>
  <blog_url>https://hnw.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>平方数とは、ある整数の平方（＝二乗）であるような整数のことを言います。つまり、0,1,4,9,16,...が平方数ということになります。 ところで、与えられた整数が平方数かどうかを判定するにはどうすれば良いでしょうか。与えられた整数の平方根の小数点以下を切り捨て、それを二乗して元の数になるかどうか、というのがすぐ思いつく実装です。 &lt;?php function is_square($n) { $sqrt = floor(sqrt($n)); return ($sqrt*$sqrt == $n); } しかし、平方根の計算は比較的重い処理です。もっと高速化する方法は無いのでしょうか。 多倍長整数…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhnw.hatenablog.com%2Fentry%2F20140503&quot; title=&quot;平方数かどうかを高速に判定する方法 - hnwの日記&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>2014-05-03 00:00:00</published>
  <title>平方数かどうかを高速に判定する方法</title>
  <type>rich</type>
  <url>https://hnw.hatenablog.com/entry/20140503</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
