ref/ruby/classes/Integer.src/M000023.html in ruby-vpi-8.1.0 vs ref/ruby/classes/Integer.src/M000023.html in ruby-vpi-8.2.0

- old
+ new

@@ -3,28 +3,23 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>split (Integer)</title> + <title>extend_sign (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 141</span> -141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split</span> <span class="ruby-identifier">aWidth</span> = <span class="ruby-value">8</span> -142: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;width must be positive and non-zero&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aWidth</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> -143: -144: <span class="ruby-identifier">int</span>, <span class="ruby-identifier">bits</span> = <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">length</span> -145: <span class="ruby-identifier">mask</span> = <span class="ruby-identifier">aWidth</span>.<span class="ruby-identifier">to_mask</span> -146: <span class="ruby-identifier">words</span> = [] -147: -148: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">bits</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> -149: <span class="ruby-identifier">words</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">int</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">mask</span> -150: <span class="ruby-identifier">int</span> <span class="ruby-operator">&gt;&gt;=</span> <span class="ruby-identifier">aWidth</span> -151: <span class="ruby-identifier">bits</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">aWidth</span> -152: <span class="ruby-keyword kw">end</span> -153: -154: <span class="ruby-identifier">words</span> -155: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 120</span> +120: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extend_sign</span> <span class="ruby-identifier">aOrigWidth</span>, <span class="ruby-identifier">aExtWidth</span> +121: <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span> +122: <span class="ruby-identifier">maskWidth</span> = <span class="ruby-identifier">aExtWidth</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">aOrigWidth</span> +123: +124: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">maskWidth</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">result</span>[<span class="ruby-identifier">aOrigWidth</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span> +125: <span class="ruby-identifier">result</span> <span class="ruby-operator">|=</span> (<span class="ruby-identifier">maskWidth</span>.<span class="ruby-identifier">to_mask</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">aOrigWidth</span>) +126: <span class="ruby-keyword kw">end</span> +127: +128: <span class="ruby-identifier">result</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">aExtWidth</span>.<span class="ruby-identifier">to_mask</span> +129: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file