ref/ruby/classes/Integer.src/M000008.html in ruby-vpi-15.0.2 vs ref/ruby/classes/Integer.src/M000008.html in ruby-vpi-16.0.0

- old
+ new

@@ -8,18 +8,18 @@ <title>log2 (Integer)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> - <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 24</span> -24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log2</span> -25: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;integer must be positive&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> -26: <span class="ruby-identifier">bin</span> = <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>) -27: -28: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^10+$/</span> -29: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> -30: <span class="ruby-keyword kw">else</span> -31: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> -32: <span class="ruby-keyword kw">end</span> -33: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 11</span> +11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log2</span> +12: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;integer must be positive&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> +13: <span class="ruby-identifier">bin</span> = <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>) +14: +15: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^10+$/</span> +16: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> +17: <span class="ruby-keyword kw">else</span> +18: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> +19: <span class="ruby-keyword kw">end</span> +20: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file