Set radix.

@param radix new radix value, must be 2..36
@return the context
979547
public final JBBPTextWriter Radix(final int radix) {
    if (radix < 2 || radix > 36) {
      throw new IllegalArgumentException("Unsupported radix value [" + radix + ']');
    }
    this.radix = radix;
    this.maxCharsRadixForByte = JBBPUtils.ulong2str(0xFFL, this.radix, CHAR_BUFFER).length();
    this.maxCharsRadixForShort = JBBPUtils.ulong2str(0xFFFFL, this.radix, CHAR_BUFFER).length();
    this.maxCharsRadixForInt = JBBPUtils.ulong2str(0xFFFFFFFFL, this.radix, CHAR_BUFFER).length();
    this.maxCharsRadixForLong = JBBPUtils.ulong2str(0xFFFFFFFFFFFFFFFFL, this.radix, CHAR_BUFFER).length();

    return this;
  }
1027413
public static BigDecimal rootFixPrecision(BigDecimal n, BigDecimal x, MathContext mathContext) {
		switch (x.signum()) {
		case 0:
			return ZERO;
		case -1:
			throw new ArithmeticException("Illegal root(x) for x < 0: x = " + x);
		}

		MathContext mc = new MathContext(mathContext.getPrecision() + 4, mathContext.getRoundingMode());
		BigDecimal acceptableError = ONE.movePointLeft(mathContext.getPrecision() + 1);

		BigDecimal factor = ONE.divide(n, mc);
		BigDecimal nMinus1 = n.subtract(ONE);
		BigDecimal result = x.divide(TWO, mc);
		BigDecimal step;

		do {
			step = factor.multiply(x.divide(BigDecimalMath.pow(result, nMinus1, mc), mc).subtract(result, mc), mc);
					
			result = result.add(step, mc);
		} while (step.abs().compareTo(acceptableError) > 0);
		
		return result.round(mathContext);
	}
759979
public PactDslJsonArray decimalType(BigDecimal number) {
      body.put(number);
      matchers.addRule(rootPath + appendArrayIndex(0), new NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL));
      return this;
  }
463068
public static void setLong(final byte[] b, final long n, final int offset) {
        b[offset + 0] = (byte) (n >>> 56);
        b[offset + 1] = (byte) (n >>> 48);
        b[offset + 2] = (byte) (n >>> 40);
        b[offset + 3] = (byte) (n >>> 32);
        b[offset + 4] = (byte) (n >>> 24);
        b[offset + 5] = (byte) (n >>> 16);
        b[offset + 6] = (byte) (n >>> 8);
        b[offset + 7] = (byte) (n >>> 0);
    }
250884
public static void setInt(final byte[] b, final int n, final int offset) {
        b[offset + 0] = (byte) (n >>> 24);
        b[offset + 1] = (byte) (n >>> 16);
        b[offset + 2] = (byte) (n >>> 8);
        b[offset + 3] = (byte) (n >>> 0);
    }
1325655
protected static BigInteger getRadixPower(BigInteger radix, int power) {
		long key = (((long) radix.intValue()) << 32) | power;
		BigInteger result = radixPowerMap.get(key);
		if(result == null) {
			if(power == 1) {
				result = radix;
			} else if((power & 1) == 0) {
				BigInteger halfPower = getRadixPower(radix, power >> 1);
				result = halfPower.multiply(halfPower);
			} else {
				BigInteger halfPower = getRadixPower(radix, (power - 1) >> 1);
				result = halfPower.multiply(halfPower).multiply(radix);
			}
			radixPowerMap.put(key, result);
		}
		return result;
	}
431116
public static String convert(byte[] raw, int radix) {
        String[] hexFormatted = new String[raw.length];
        int index = 0;
        for (byte b : raw) {
            String num = Integer.toUnsignedString(Byte.toUnsignedInt(b), radix);
            hexFormatted[index++] = ("00" + num).substring(num.length());
        }
        return Arrays.toString(hexFormatted);
    }
143832
private function buildDigitList($radix)
    {
        if ($radix <= strlen(self::$integerBase)) {
            return str_split(substr(self::$integerBase, 0, $radix));
        } elseif ($radix === 64) {
            return str_split(self::$integerBase64);
        } elseif ($radix <= 256) {
            return range(chr(0), chr($radix - 1));
        }

        return $this->buildArbitraryList($radix);
    }
1342400
public void set(CharSequence number) {
    // reset the operands
    negative = false;
    decimal = false;
    ni = 0;
    nd = 0;
    v = 0;
    w = 0;
    t = 0;
    z = 0;

    int length = number.length();
    if (length < 1) {
      return;
    }

    // index into the string
    int i = 0;
    if (number.charAt(0) == '-') {
      negative = true;
      i++;
    }

    // track number of trailing zeros in floating mode
    long trail = 0;

    // indicates a non-zero leading digit on the decimal part.
    boolean leading = false;

    // indicates an unexpected character was encountered.
    boolean fail = false;

    while (i < length) {
      char ch = number.charAt(i);
      switch (ch) {
        case '0':
          if (decimal) {
            v++;
            if (leading) {
              trail++;
            } else {
              z++;
            }
          }
          if (nd > 0) {
            nd *= 10;
          }
          nd += (long)(ch - '0');
          break;

        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
          if (decimal) {
            v++;
            leading = true;
          }
          trail = 0;
          if (nd > 0) {
            nd *= 10;
          }
          nd += (long)(ch - '0');
          break;

        case '.':
          if (decimal) {
            fail = true;
          } else {
            decimal = true;
            ni = nd;
            nd = 0;
          }
          break;

        default:
          fail = true;
          break;
      }

      if (fail) {
        break;
      }

      // Check for imminent overflow and reduce or bail out.
      if (decimal) {
        if (nd >= LIMIT) {
          break;
        }
      } else {
        nd = integerReduce(nd);
      }

      i++;
    }

    // If no non-zero leading digit was detected, record the zeroes as trailing
    // digits and reset the leading zero count.
    if (!leading) {
      trail = z;
      z = 0;
    }

    // calculate the final values of operands tracking digit counts
    if (decimal) {
      w = v - trail;
    } else {
      // swap if we never saw a decimal point
      ni = nd;
      nd = 0;
    }

    t = nd;
    for (int j = 0; j < trail; j++) {
      t /= 10;
    }
  }
892575
function fromString (s, radix) {
		var value = parseInt(s, radix || 10)

		this._low = value & 0xFFFF
		this._high = value >>> 16

		return this
	}
1072241
public static final IntStream toDigits(long v, int length, int radix)
    {
        Spliterator.OfInt spliterator = Spliterators.spliterator(new PRimIt(v, length, radix), Long.MAX_VALUE, 0);
        return StreamSupport.intStream(spliterator, false);
    }
357447
public static PactDslJsonRootValue hexValue(String hexValue) {
    if (!hexValue.matches(HEXADECIMAL)) {
      throw new InvalidMatcherException(EXAMPLE + hexValue + "\" is not a hexadecimal value");
    }
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    value.setValue(hexValue);
    value.setMatcher(value.regexp("[0-9a-fA-F]+"));
    return value;
  }
1121485
def set_decimal(self, pos, decimal):
        
        if pos < 0 or pos > 3:
            # Ignore out of bounds digits.
            return
        # Set bit 14 (decimal point) based on provided value.
        if decimal:
            self.buffer[pos*2+1] |= (1 << 6)
        else:
            self.buffer[pos*2+1] &= ~(1 << 6)
500465
@Override
  public void setRadii(float[] radii) {
    if (radii == null) {
      Arrays.fill(mCornerRadii, 0);
      mRadiiNonZero = false;
    } else {
      Preconditions.checkArgument(radii.length == 8, "radii should have exactly 8 values");
      System.arraycopy(radii, 0, mCornerRadii, 0, 8);
      mRadiiNonZero = false;
      for (int i = 0; i < 8; i++) {
        mRadiiNonZero |= (radii[i] > 0);
      }
    }
    mIsPathDirty = true;
    invalidateSelf();
  }
1065222
def consumeNumberEntity(self, isHex):
        

        allowed = digits
        radix = 10
        if isHex:
            allowed = hexDigits
            radix = 16

        charStack = []

        # Consume all the characters that are in range while making sure we
        # don't hit an EOF.
        c = self.stream.char()
        while c in allowed and c is not EOF:
            charStack.append(c)
            c = self.stream.char()

        # Convert the set of characters consumed to an int.
        charAsInt = int("".join(charStack), radix)

        # Certain characters get replaced with others
        if charAsInt in replacementCharacters:
            char = replacementCharacters[charAsInt]
            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
                                    "illegal-codepoint-for-numeric-entity",
                                    "datavars": {"charAsInt": charAsInt}})
        elif ((0xD800 <= charAsInt <= 0xDFFF) or
              (charAsInt > 0x10FFFF)):
            char = "\uFFFD"
            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
                                    "illegal-codepoint-for-numeric-entity",
                                    "datavars": {"charAsInt": charAsInt}})
        else:
            # Should speed up this check somehow (e.g. move the set to a constant)
            if ((0x0001 <= charAsInt <= 0x0008) or
                (0x000E <= charAsInt <= 0x001F) or
                (0x007F <= charAsInt <= 0x009F) or
                (0xFDD0 <= charAsInt <= 0xFDEF) or
                charAsInt in frozenset([0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
                                        0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE,
                                        0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
                                        0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE,
                                        0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
                                        0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE,
                                        0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
                                        0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE,
                                        0xFFFFF, 0x10FFFE, 0x10FFFF])):
                self.tokenQueue.append({"type": tokenTypes["ParseError"],
                                        "data":
                                        "illegal-codepoint-for-numeric-entity",
                                        "datavars": {"charAsInt": charAsInt}})
            try:
                # Try/except needed as UCS-2 Python builds' unichar only works
                # within the BMP.
                char = chr(charAsInt)
            except ValueError:
                v = charAsInt - 0x10000
                char = chr(0xD800 | (v >> 10)) + chr(0xDC00 | (v & 0x3FF))

        # Discard the ; if present. Otherwise, put it back on the queue and
        # invoke parseError on parser.
        if c != ";":
            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
                                    "numeric-entity-without-semicolon"})
            self.stream.unget(c)

        return char
590266
public void set(int index) {
		Preconditions.checkArgument(index < bitLength && index >= 0);

		int byteIndex = (index & BYTE_POSITION_MASK) >>> 3;
		byte current = memorySegment.get(offset + byteIndex);
		current |= (1 << (index & BYTE_INDEX_MASK));
		memorySegment.put(offset + byteIndex, current);
	}
956441
public QrCodeEncoder addNumeric(byte[] numbers) {
		for (int i = 0; i < numbers.length; i++) {
			if (numbers[i] < 0 || numbers[i] > 9)
				throw new IllegalArgumentException("All numbers must have a value from 0 to 9");
		}

		StringBuilder builder = new StringBuilder(numbers.length);
		for (int i = 0; i < numbers.length; i++) {
			builder.append(Integer.toString(numbers[i]));
		}
		MessageSegment segment = new MessageSegment();
		segment.message = builder.toString();
		segment.data = numbers;
		segment.length = numbers.length;
		segment.mode = QrCode.Mode.NUMERIC;

		segment.encodedSizeBits += 4;
		segment.encodedSizeBits += 10*(segment.length/3);
		if( segment.length%3 == 2 ) {
			segment.encodedSizeBits += 7;
		} else if( segment.length%3 == 1 ) {
			segment.encodedSizeBits += 4;
		}

		segments.add(segment);

		return this;
	}