Sha256: a1ba16b8636d729b7fde7cfe410fc27d67e3990d9b837179c0ec3a40ea536602

Contents?: true

Size: 2 KB

Versions: 7

Compression:

Stored size: 2 KB

Contents

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <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 97</span>
 97:   <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>
 98:     <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>
 99:     <span class="ruby-identifier">maskWidth</span> = <span class="ruby-identifier">aExtWidth</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">aOrigWidth</span>
100: 
101:     <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>
102:       <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>)
103:     <span class="ruby-keyword kw">end</span>
104: 
105:     <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>
106:   <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-vpi-16.0.1 ref/ruby/classes/Integer.src/M000018.html
ruby-vpi-16.0.0 ref/ruby/classes/Integer.src/M000018.html
ruby-vpi-17.0.0 ref/ruby/classes/Integer.src/M000019.html
ruby-vpi-18.0.0 ref/ruby/classes/Integer.src/M000019.html
ruby-vpi-19.0.0 ref/ruby/classes/Integer.src/M000017.html
ruby-vpi-18.0.2 ref/ruby/classes/Integer.src/M000019.html
ruby-vpi-18.0.1 ref/ruby/classes/Integer.src/M000019.html