Extract the sign (the leftmost bit), exponent (the 11 following bits)
and mantissa (the 52 rightmost bits) from a double.
@see http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Tech/Chapter02/floatingPt.html
4346
public static final long[] getExpAndMantissa(double myDouble) {
		long lbits = Double.doubleToLongBits(myDouble);
		long lsign = lbits >>> 63;// 0(+) or 1(-)
		long lexp = (lbits >>> 52 & ((1 << 11) - 1)) - ((1 << 10) - 1);
		long lmantissa = lbits & ((1L << 52) - 1);
		long[] ret = new long[] { lsign, lexp, lmantissa };
		log.debug("double  : " + myDouble);
		log.debug("sign    : " + lsign);
		log.debug("exp     : " + lexp);
		log.debug("mantissa: " + lmantissa);
		log.debug("reverse : " + Double.longBitsToDouble((lsign << 63)	| (lexp + ((1 << 10) - 1)) << 52 | lmantissa));
		log.debug("log(d)  : " + Math.log1p(myDouble));
		return ret;
	}
204731
private static double getRightAscension(double Ls) {
        return Math.atan2(Math.sin(Ls) * Math.cos(e), Math.cos(Ls));
    }
38288
public static String byteToBits(byte b) {
        return ""
            + (byte) ((b >> 7) & 0x01) + (byte) ((b >> 6) & 0x1)
            + (byte) ((b >> 5) & 0x01) + (byte) ((b >> 4) & 0x1)
            + (byte) ((b >> 3) & 0x01) + (byte) ((b >> 2) & 0x1)
            + (byte) ((b >> 1) & 0x01) + (byte) ((b >> 0) & 0x1);
    }
96155
function bnpToRadix(b) {
    if (b == null) b = 10;
    if (this.signum() === 0 || b < 2 || b > 36) return "0";
    var cs = this.chunkSize(b);
    var a = Math.pow(b, cs);
    var d = nbv(a), y = nbi(), z = nbi(), r = "";
    this.divRemTo(d, y, z);
    while (y.signum() > 0) {
        r = (a + z.intValue()).toString(b).substr(1) + r;
        y.divRemTo(d, y, z);
    }
    return z.intValue().toString(b) + r;
}
153487
public int last()
    {
        for (int ii=array.length-1;ii>=0;ii--)
        {
            if (array[ii] != 0)
            {
                for (int jj=Math.min(bits,(ii+1)*8)-1;jj>=0;jj--)
                {
                    if (isSet(jj))
                    {
                        return jj;
                    }
                }
            }
        }
        return -1;
    }
241647
function(left, right) {
  if (!left && !right) {
    return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
  }

  var leftHigh = left.shiftRightUnsigned(32);
  var leftLow = new Long(left.getLowBits(), 0);
  var rightHigh = right.shiftRightUnsigned(32);
  var rightLow = new Long(right.getLowBits(), 0);

  var productHigh = leftHigh.multiply(rightHigh);
  var productMid = leftHigh.multiply(rightLow);
  var productMid2 = leftLow.multiply(rightHigh);
  var productLow = leftLow.multiply(rightLow);

  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  productMid = new Long(productMid.getLowBits(), 0)
    .add(productMid2)
    .add(productLow.shiftRightUnsigned(32));

  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));

  // Return the 128 bit result
  return { high: productHigh, low: productLow };
}
177706
public int getTotalBits() {
    //this total calculates and removes the bits reserved for "offset"
    //   between the different children.
    int total = 0;
    EncodedElement iter = this;
    while(iter != null) {
      total += iter.usableBits - iter.offset;
      iter = iter.next;
    }
    return total;
  }
1236264
function(other) {

    // If sign bits differ ...
    if ((this.buffer[this.offset] & 0x80) != (other.buffer[other.offset] & 0x80)) {
      return other.buffer[other.offset] - this.buffer[this.offset];
    }

    // otherwise, compare bytes lexicographically
    for (var i = 0; i < 8; i++) {
      if (this.buffer[this.offset+i] !== other.buffer[other.offset+i]) {
        return this.buffer[this.offset+i] - other.buffer[other.offset+i];
      }
    }
    return 0;
  }
692259
private ExprKraken parseAddExpr()
  {
    ExprKraken left = parseMulExpr();

    while (true) {
      Token token = scanToken();

      switch (token) {
      case PLUS:
        left = new BinaryExpr(BinaryOp.ADD, left, parseSimpleTerm());
        break;
      case MINUS:
        left = new BinaryExpr(BinaryOp.SUB, left, parseSimpleTerm());
        break;

      default:
        _token = token;
        return left;
      }
    }
  }
1166260
function bits( x ) {
	var b;

	// Convert the input value to a bit string:
	b = div2( x );

	// Left pad the bit string to ensure 8 bits are represented:
	b = lpad( b, NBITS, '0' );

	return b;
}
423988
function() {
        this.n_sign = null; // sign
        this.n_len = null;  /* (int) The number of digits before the decimal point. */
        this.n_scale = null; /* (int) The number of digits after the decimal point. */
        //this.n_refs = null; /* (int) The number of pointers to this number. */
        //this.n_text = null; /* ?? Linked list for available list. */
        this.n_value = null;  /* array as value, where 1.23 = [1,2,3] */
        this.toString = function() {
            var r, tmp;
            tmp=this.n_value.join('');

            // add minus sign (if applicable) then add the integer part
            r = ((this.n_sign == libbcmath.PLUS) ? '' : this.n_sign) + tmp.substr(0, this.n_len);

            // if decimal places, add a . and the decimal part
            if (this.n_scale > 0) {
                r += '.' + tmp.substr(this.n_len, this.n_scale);
            }
            return r;
        };

        this.setScale = function(newScale) {
            while (this.n_scale < newScale) {
                this.n_value.push(0);
                this.n_scale++;
            }
            while (this.n_scale > newScale) {
                this.n_value.pop();
                this.n_scale--;
            }
            return this;
        }

    }
375392
public static int getExponent(float f){
        /*
         * Bitwise convert f to integer, mask out exponent bits, shift
         * to the right and then subtract out float's bias adjust to
         * get true exponent value
         */
        return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >>
                (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS;
    }
1150877
private static float bytesToFloat(byte b0, byte b1, byte b2, byte b3) {
        int mantissa = unsignedToSigned(unsignedByteToInt(b0)
                + (unsignedByteToInt(b1) << 8)
                + (unsignedByteToInt(b2) << 16), 24);
        return (float) (mantissa * Math.pow(10, b3));
    }
1034250
private static float[] getFloats(String s) {
    if (s.charAt(0) == 'z' | s.charAt(0) == 'Z') {
      return new float[0];
    }
    try {
      float[] results = new float[s.length()];
      int count = 0;
      int startPosition = 1;
      int endPosition = 0;

      ExtractFloatResult result = new ExtractFloatResult();
      int totalLength = s.length();

      // The startPosition should always be the first character of the
      // current number, and endPosition is the character after the current
      // number.
      while (startPosition < totalLength) {
        extract(s, startPosition, result);
        endPosition = result.mEndPosition;

        if (startPosition < endPosition) {
          results[count++] = Float.parseFloat(
              s.substring(startPosition, endPosition));
        }

        if (result.mEndWithNegSign) {
          // Keep the '-' sign with next number.
          startPosition = endPosition;
        } else {
          startPosition = endPosition + 1;
        }
      }
      return Utils.copyOf(results, count);
    } catch (NumberFormatException e) {
      Log.e(LOGTAG, "error in parsing \"" + s + "\"");
      throw e;
    }
  }
1338021
protected function parseSymbolsAfterDigits()
	{
		if (!$this->hasSingleQuote && !$this->hasDoubleQuote && strpos($this->text, 'x') === false)
		{
			return;
		}

		$map = [
			// 80's -- use an apostrophe
			"'s" => "\xE2\x80\x99",
			// 12' or 12" -- use a prime
			"'"  => "\xE2\x80\xB2",
			"' " => "\xE2\x80\xB2",
			"'x" => "\xE2\x80\xB2",
			'"'  => "\xE2\x80\xB3",
			'" ' => "\xE2\x80\xB3",
			'"x' => "\xE2\x80\xB3"
		];

		$regexp = "/[0-9](?>'s|[\"']? ?x(?= ?[0-9])|[\"'])/S";
		preg_match_all($regexp, $this->text, $matches, PREG_OFFSET_CAPTURE);
		foreach ($matches[0] as $m)
		{
			// Test for a multiply sign at the end
			if (substr($m[0], -1) === 'x')
			{
				$this->addTag($m[1] + strlen($m[0]) - 1, 1, "\xC3\x97");
			}

			// Test for an apostrophe/prime right after the digit
			$str = substr($m[0], 1, 2);
			if (isset($map[$str]))
			{
				$this->addTag($m[1] + 1, 1, $map[$str]);
			}
		}
	}
973737
def _absf(ins):
    ''' 
    '''
    output = _float_oper(ins.quad[2])
    output.append('res 7, e')  # Just resets the sign bit!
    output.extend(_fpush())
    return output
1328208
private long computeUndefNum(final Tristate[] bits) {
    long sum = 0;
    for (int i = bits.length - 1; i >= 0; i--)
      if (bits[i] == Tristate.UNDEF)
        sum += Math.pow(2, bits.length - 1 - i);
    return sum;
  }