<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>obelisk2</author_name>
  <author_url>https://blog.hatena.ne.jp/obelisk2/</author_url>
  <blog_title>Camera Obscura</blog_title>
  <blog_url>https://obelisk.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>C言語</anon>
    <anon>数学</anon>
    <anon>Gem</anon>
  </categories>
  <description>なぜか Ruby 本体には、約数を求めるメソッドがないようですので、C拡張で作ってみました。以前書いた Utilsc への機能追加です。コードは必要な部分だけ載せます。全体のコードはここ です。 #include &quot;utilsc.h&quot; #include &quot;math.h&quot; VALUE divisors(VALUE self) { int a; long i, se; VALUE ar; se = FIX2LONG(self); ar = rb_ary_new(); a = (int)sqrt(se); for (i = 1; i &lt;= a; i++) { if (!(se % i)) { rb_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2016%2F05%2F03%2F020549&quot; title=&quot;Ruby の C拡張で約数を求めるメソッドを書いた - Camera Obscura&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>2016-05-03 02:05:49</published>
  <title>Ruby の C拡張で約数を求めるメソッドを書いた</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2016/05/03/020549</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
