Changeset 8543 in project


Ignore:
Timestamp:
02/17/08 19:54:32 (11 years ago)
Author:
kon
Message:

Added fix & flo extras.

Location:
release/3/mathh
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • release/3/mathh/tags/1.10/bitwise-extras.scm

    r8512 r8543  
    2626    bitwise-list->integer
    2727    bitwise-integer->list
     28    bitwise-arithmetic-shift
     29    bitwise-arithmetic-shift-left
     30    bitwise-arithmetic-shift-right
    2831    ; Unchecked
    2932    %bitwise-if
     
    265268  (if b #b1 #b0) )
    266269
     270;;;
     271
    267272(define %bitwise-if
    268273  (foreign-lambda* unsigned-int ((integer mask) (integer t) (integer f))
     
    300305
    301306(define %bitwise-copy-bit
    302   (foreign-lambda* integer ((integer to) (unsigned-int start) (unsigned-int bit))
    303    "return (BIT_COPY( to, start, bit ));"))
     307  (foreign-lambda* integer ((integer to) (unsigned-int index) (unsigned-int bit))
     308   "return (BIT_COPY( to, index, bit ));"))
    304309
    305310(define %bitwise-bit-field
     
    379384      (%boolean->bit bit)) )
    380385
     386;;;
     387
    381388(define (bitwise-if mask t f)
    382389  (check-integer 'bitwise-if mask)
     
    417424  (%bitwise-bit-set? value index))
    418425
    419 (define (bitwise-copy-bit to start bit)
     426(define (bitwise-copy-bit to index bit)
    420427  (check-integer 'bitwise-copy-bit to)
    421   (check-non-negative-integer 'bitwise-copy-bit start)
    422   (%bitwise-copy-bit to start (boolean->bit bit)) )
     428  (check-non-negative-integer 'bitwise-copy-bit index)
     429  (%bitwise-copy-bit to index (boolean->bit bit)) )
    423430
    424431(define (bitwise-bit-field value start end)
     
    465472  (when bitlen (check-non-negative-integer 'bitwise-integer->list bitlen))
    466473  (%bitwise-integer->list value bitlen) )
     474
     475;;;
     476
     477(define bitwise-arithmetic-shift arithmetic-shift)
     478
     479(define (bitwise-arithmetic-shift-left value amount)
     480  (check-non-negative-integer 'bitwise-arithmetic-shift-left amount)
     481  (arithmetic-shift value amount) )
     482
     483(define (bitwise-arithmetic-shift-right value amount)
     484  (check-non-negative-integer 'bitwise-arithmetic-shift-right amount)
     485  (arithmetic-shift value (- amount)) )
  • release/3/mathh/tags/1.10/mathh.html

    r8512 r8543  
    576576<td>theta(3)</td></tr></table></div>
    577577<div class="subsection">
     578<h4>Fixnum Procedures</h4>
     579<div class="section">
     580<h3>Usage</h3>(require-extension fixnum-extras)</div></div>
     581<div class="subsection">
     582<h4>Flonum Procedures</h4>
     583<div class="section">
     584<h3>Usage</h3>(require-extension flonum-extras)</div></div>
     585<div class="subsection">
    578586<h4>Bitwise Procedures</h4>
    579587<div class="section">
     
    627635<dt class="definition"><strong>procedure:</strong> (bitwise-list-&gt;integer LIST)</dt>
    628636<dd>
    629 <p>List of boolean to integer.</p></dd>
     637<p>Converts list of boolean, least-significant to most-significant, to integer.</p></dd>
    630638<dt class="definition"><strong>procedure:</strong> (bitwise-integer-&gt;list VALUE [LENGTH])</dt>
    631639<dd>
    632 <p>Integer to list of boolean, least-significant to most-significant.</p></dd></div></div>
     640<p>Converts integer to list of boolean, least-significant to most-significant.</p></dd></div></div>
    633641<div class="section">
    634642<h3>Version</h3>
  • release/3/mathh/tags/1.10/mathh.meta

    r8512 r8543  
    1717        "mathh-fpclass.scm"
    1818        "bitwise-extras.scm"
    19         ;;"fixnum-extras.scm"
     19        "fixnum-extras.scm"
     20        "flonum-extras.scm"
    2021        "mathh.setup"
    2122        "mathh.html") )
  • release/3/mathh/tags/1.10/mathh.setup

    r8510 r8543  
    2626        (install-dynld mathh-fpclass *version* (documentation "mathh.html")))
    2727
    28 #;
    2928(install-dynld fixnum-extras *version* (documentation "mathh.html"))
     29
     30(install-dynld flonum-extras *version* (documentation "mathh.html"))
    3031
    3132(install-dynld bitwise-extras *version* (documentation "mathh.html"))
  • release/3/mathh/trunk/bitwise-extras.scm

    r8511 r8543  
    2626    bitwise-list->integer
    2727    bitwise-integer->list
     28    bitwise-arithmetic-shift
     29    bitwise-arithmetic-shift-left
     30    bitwise-arithmetic-shift-right
    2831    ; Unchecked
    2932    %bitwise-if
     
    265268  (if b #b1 #b0) )
    266269
     270;;;
     271
    267272(define %bitwise-if
    268273  (foreign-lambda* unsigned-int ((integer mask) (integer t) (integer f))
     
    300305
    301306(define %bitwise-copy-bit
    302   (foreign-lambda* integer ((integer to) (unsigned-int start) (unsigned-int bit))
    303    "return (BIT_COPY( to, start, bit ));"))
     307  (foreign-lambda* integer ((integer to) (unsigned-int index) (unsigned-int bit))
     308   "return (BIT_COPY( to, index, bit ));"))
    304309
    305310(define %bitwise-bit-field
     
    379384      (%boolean->bit bit)) )
    380385
     386;;;
     387
    381388(define (bitwise-if mask t f)
    382389  (check-integer 'bitwise-if mask)
     
    417424  (%bitwise-bit-set? value index))
    418425
    419 (define (bitwise-copy-bit to start bit)
     426(define (bitwise-copy-bit to index bit)
    420427  (check-integer 'bitwise-copy-bit to)
    421   (check-non-negative-integer 'bitwise-copy-bit start)
    422   (%bitwise-copy-bit to start (boolean->bit bit)) )
     428  (check-non-negative-integer 'bitwise-copy-bit index)
     429  (%bitwise-copy-bit to index (boolean->bit bit)) )
    423430
    424431(define (bitwise-bit-field value start end)
     
    465472  (when bitlen (check-non-negative-integer 'bitwise-integer->list bitlen))
    466473  (%bitwise-integer->list value bitlen) )
     474
     475;;;
     476
     477(define bitwise-arithmetic-shift arithmetic-shift)
     478
     479(define (bitwise-arithmetic-shift-left value amount)
     480  (check-non-negative-integer 'bitwise-arithmetic-shift-left amount)
     481  (arithmetic-shift value amount) )
     482
     483(define (bitwise-arithmetic-shift-right value amount)
     484  (check-non-negative-integer 'bitwise-arithmetic-shift-right amount)
     485  (arithmetic-shift value (- amount)) )
  • release/3/mathh/trunk/doc.scm

    r8511 r8543  
    220220      )
    221221
    222       #;
    223222      (subsection "Fixnum Procedures"
    224223
    225224        (usage "(require-extension fixnum-extras)")
     225
     226      )
     227
     228      (subsection "Flonum Procedures"
     229
     230        (usage "(require-extension flonum-extras)")
    226231
    227232      )
  • release/3/mathh/trunk/mathh.html

    r8511 r8543  
    576576<td>theta(3)</td></tr></table></div>
    577577<div class="subsection">
     578<h4>Fixnum Procedures</h4>
     579<div class="section">
     580<h3>Usage</h3>(require-extension fixnum-extras)</div></div>
     581<div class="subsection">
     582<h4>Flonum Procedures</h4>
     583<div class="section">
     584<h3>Usage</h3>(require-extension flonum-extras)</div></div>
     585<div class="subsection">
    578586<h4>Bitwise Procedures</h4>
    579587<div class="section">
     
    627635<dt class="definition"><strong>procedure:</strong> (bitwise-list-&gt;integer LIST)</dt>
    628636<dd>
    629 <p>List of boolean to integer.</p></dd>
     637<p>Converts list of boolean, least-significant to most-significant, to integer.</p></dd>
    630638<dt class="definition"><strong>procedure:</strong> (bitwise-integer-&gt;list VALUE [LENGTH])</dt>
    631639<dd>
    632 <p>Integer to list of boolean, least-significant to most-significant.</p></dd></div></div>
     640<p>Converts integer to list of boolean, least-significant to most-significant.</p></dd></div></div>
    633641<div class="section">
    634642<h3>Version</h3>
  • release/3/mathh/trunk/mathh.meta

    r8511 r8543  
    1717        "mathh-fpclass.scm"
    1818        "bitwise-extras.scm"
    19         ;;"fixnum-extras.scm"
     19        "fixnum-extras.scm"
     20        "flonum-extras.scm"
    2021        "mathh.setup"
    2122        "mathh.html") )
  • release/3/mathh/trunk/mathh.setup

    r8510 r8543  
    2626        (install-dynld mathh-fpclass *version* (documentation "mathh.html")))
    2727
    28 #;
    2928(install-dynld fixnum-extras *version* (documentation "mathh.html"))
     29
     30(install-dynld flonum-extras *version* (documentation "mathh.html"))
    3031
    3132(install-dynld bitwise-extras *version* (documentation "mathh.html"))
Note: See TracChangeset for help on using the changeset viewer.