Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • rtoy's avatar
    d61a8a8b
    Better conversion of bignums to double-double-floats. Also fixes the · d61a8a8b
    rtoy authored
    silly bug that (float <neg bignum> 1w0) was returning a positive
    result instead of negative.
    
    o Rename DOUBLE-DOUBLE-FLOAT to DOUBLE-DOUBLE-FLOAT-FROM-BITS to match
      other functions and to make it separate from the same function in
      the KERNEL package.
    o Modify DOUBLE-DOUBLE-FLOAT-FROM-BITS to look at the bignum and
      extract out the pieces better.  Look for a pattern <53 bits> <zeroes>
      <53 bits> where <zeroes> is a set of consecutive zero bits.  We use
      the 2 53-bit sections to create the double-double-float.
    o Make DOUBLE-DOUBLE-FLOAT-FROM-BITS honor the sign.
    o Add BIGNUM-FLOAT-DIGITS to figure out how many bits of the bignum
      should be used to create the float.
    o Call BIGNUM-FLOAT-DIGITS from BIGNUM-TO-FLOAT instead of using
      FLOAT-FORMAT-DIGITS.
    d61a8a8b
    History
    Better conversion of bignums to double-double-floats. Also fixes the
    rtoy authored
    silly bug that (float <neg bignum> 1w0) was returning a positive
    result instead of negative.
    
    o Rename DOUBLE-DOUBLE-FLOAT to DOUBLE-DOUBLE-FLOAT-FROM-BITS to match
      other functions and to make it separate from the same function in
      the KERNEL package.
    o Modify DOUBLE-DOUBLE-FLOAT-FROM-BITS to look at the bignum and
      extract out the pieces better.  Look for a pattern <53 bits> <zeroes>
      <53 bits> where <zeroes> is a set of consecutive zero bits.  We use
      the 2 53-bit sections to create the double-double-float.
    o Make DOUBLE-DOUBLE-FLOAT-FROM-BITS honor the sign.
    o Add BIGNUM-FLOAT-DIGITS to figure out how many bits of the bignum
      should be used to create the float.
    o Call BIGNUM-FLOAT-DIGITS from BIGNUM-TO-FLOAT instead of using
      FLOAT-FORMAT-DIGITS.