Converting four bytes to a Big Endian float.

@param b1 the first byte.
@param b2 the second byte.
@param b3 the third byte.
@param b4 the fourth byte.
@return the conversion result
549464
@Pure
	@Inline(value = "Float.intBitsToFloat(EndianNumbers.toBEInt($1, $2, $3, $4))",
			imported = {EndianNumbers.class})
	public static float toBEFloat(int b1, int b2, int b3, int b4) {
		return Float.intBitsToFloat(toBEInt(b1, b2, b3, b4));
	}
611808
public static int readInt(byte b[], int offset) {
    int retValue;

    retValue = ((int)b[offset++]) << 24;
    retValue |= ((int)b[offset++] & 0xff) << 16;
    retValue |= ((int)b[offset++] & 0xff) << 8;
    retValue |= (int)b[offset] & 0xff;

    return retValue;
  }
389695
private static final long get32(byte b[], int off) {
        return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL;
    }
398347
public static float getFloat(byte[] b) {
        int accum = 0;
        accum = accum | (b[0] & 0xff) << 0;
        accum = accum | (b[1] & 0xff) << 8;
        accum = accum | (b[2] & 0xff) << 16;
        accum = accum | (b[3] & 0xff) << 24;
        return Float.intBitsToFloat(accum);
    }
1027444
public static byte[] concat(Bytes b1, Bytes b2) {
    int offset = 0;
    int size = b1.length() + checkVlen(b1.length()) + b2.length() + checkVlen(b2.length());

    byte[] data = new byte[size];

    offset = writeVint(data, offset, b1.length());
    b1.copyTo(data, offset);
    offset += b1.length();

    offset = writeVint(data, offset, b2.length());
    b2.copyTo(data, offset);

    return data;
  }
1316518
public static void setInt(int n, byte[] b, int off, boolean littleEndian) {
		if (littleEndian) {
			b[off] = (byte) n;
			b[off + 1] = (byte) (n >>> 8);
			b[off + 2] = (byte) (n >>> 16);
			b[off + 3] = (byte) (n >>> 24);
		} else {
			b[off] = (byte) (n >>> 24);
			b[off + 1] = (byte) (n >>> 16);
			b[off + 2] = (byte) (n >>> 8);
			b[off + 3] = (byte) n;
		}
	}
920692
public static void elementMultConjB( InterleavedF64 a , InterleavedF64 b , InterleavedF64 output ) {
		for( int y = 0; y < a.height; y++ ) {

			int index = a.startIndex + y*a.stride;

			for( int x = 0; x < a.width; x++, index += 2 ) {

				double realA = a.data[index];
				double imgA = a.data[index+1];
				double realB = b.data[index];
				double imgB = b.data[index+1];

				output.data[index] = realA*realB + imgA*imgB;
				output.data[index+1] = -realA*imgB + imgA*realB;
			}
		}
	}
636888
function bnpFromNumber(a,b,c) {
  if("number" == typeof b) {
    // new BigInteger(int,int,RNG)
    if(a < 2) this.fromInt(1);
    else {
      this.fromNumber(a,c);
      if(!this.testBit(a-1))	// force MSB set
        this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
      if(this.isEven()) this.dAddOffset(1,0); // force odd
      while(!this.isProbablePrime(b)) {
        this.dAddOffset(2,0);
        if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
      }
    }
  }
  else {
    // todo: we don't need this.
    // new BigInteger(int,RNG)
    var x = new Array(), t = a&7;
    x.length = (a>>3)+1;
    b.nextBytes(x);
    if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
    this.fromString(x,256);
  }
}
1153937
def endianSwapU16(bytes):
    """"""
    for b in range(0, len(bytes), 2):
        bytes[b], bytes[b + 1] = bytes[b + 1], bytes[b]
    return bytes
1366822
public static FloatBinding max(final float a, final ObservableFloatValue b) {
        return createFloatBinding(() -> Math.max(a, b.get()), b);
    }
622334
def weighted_hamming(b1, b2):
    
    assert(len(b1) == len(b2))
    hamming = 0
    for i in range(len(b1)):
        if b1[i] != b2[i]:
            # differences at more significant (leftward) bits
            # are more important
            if i > 0:
                hamming += 1 + 1.0/i
                # This weighting is completely arbitrary
    return hamming
811578
public static long readLong(byte b[], int offset) {
    long retValue;

    retValue = ((long)b[offset++]) << 56;
    retValue |= ((long)b[offset++] & 0xff) << 48;
    retValue |= ((long)b[offset++] & 0xff) << 40;
    retValue |= ((long)b[offset++] & 0xff) << 32;
    retValue |= ((long)b[offset++] & 0xff) << 24;
    retValue |= ((long)b[offset++] & 0xff) << 16;
    retValue |= ((long)b[offset++] & 0xff) << 8;
    retValue |= (long)b[offset] & 0xff;

    return retValue;
  }
727069
public static byte[] xorAlignRight(byte[] b1, byte[] b2) {
        if (b1.length > b2.length) {
            byte[] b2_ = new byte[b1.length];
            System.arraycopy(b2, 0, b2_, b1.length - b2.length, b2.length);
            b2 = b2_;
        } else if (b2.length > b1.length) {
            byte[] b1_ = new byte[b2.length];
            System.arraycopy(b1, 0, b1_, b2.length - b1.length, b1.length);
            b1 = b1_;
        }

        return xor(b1, b2);
    }
802174
@GwtIncompatible("doesn't work")
  public static int fromBytes(byte b1, byte b2, byte b3, byte b4) {
    return b1 << 24 | (b2 & 0xFF) << 16 | (b3 & 0xFF) << 8 | (b4 & 0xFF);
  }
530429
private byte[] bufB(int bpv) {
    assert bpv == 1 || bpv == 2 : "Only bit vectors with/without NA are supported";
    final int off = CBSChunk.OFF;
    int clen  = off + CBSChunk.clen(_len, bpv);
    byte bs[] = new byte[clen];
    // Save the gap = number of unfilled bits and bpv value
    bs[0] = (byte) (((_len*bpv)&7)==0 ? 0 : (8-((_len*bpv)&7)));
    bs[1] = (byte) bpv;

    // Dense bitvector
    int  boff = 0;
    byte b    = 0;
    int  idx  = CBSChunk.OFF;
    int j = 0;
    for (int i=0; i<_len; i++) {
      byte val = 0;
      if(_id == null || (j < _id.length && _id[j] == i)) {
        assert bpv == 2 || !isNA2(j);
        val = (byte)(isNA2(j)?CBSChunk._NA:_ls[j]);
        ++j;
      }
      if( bpv==1 )
        b = CBSChunk.write1b(b, val, boff);
      else
        b = CBSChunk.write2b(b, val, boff);
      boff += bpv;
      if (boff>8-bpv) { assert boff == 8; bs[idx] = b; boff = 0; b = 0; idx++; }
    }
    assert j == _sparseLen;
    assert bs[0] == (byte) (boff == 0 ? 0 : 8-boff):"b[0] = " + bs[0] + ", boff = " + boff + ", bpv = " + bpv;
    // Flush last byte
    if (boff>0) bs[idx] = b;
    return bs;
  }
342984
private static float bytesToFloat(byte b0, byte b1) {
        int mantissa = unsignedToSigned(unsignedByteToInt(b0)
                + ((unsignedByteToInt(b1) & 0x0F) << 8), 12);
        int exponent = unsignedToSigned(unsignedByteToInt(b1) >> 4, 4);
        return (float) (mantissa * Math.pow(10, exponent));
    }
1112813
public static byte[] appendByte(byte[] bytes, byte b) {
        byte[] result = Arrays.copyOf(bytes, bytes.length + 1);
        result[result.length - 1] = b;
        return result;
    }