• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/JavaScriptCore-7600.1.17/runtime/

Lines Matching defs:radix

146 // Mapping from integers 0..35 to digit identifying this value, for radix 2..36.
149 static char* toStringWithRadix(RadixBuffer& buffer, double number, unsigned radix)
152 ASSERT(radix >= 2 && radix <= 36);
165 // We use this to test for odd values in odd radix bases.
168 // is even. if the radix is odd, then the radix raised to an integer power is also odd.
176 // Also initialize digit to this value; for even radix values we only need track whether
227 if (dComparePoint5 > 0 || (!dComparePoint5 && (radix & 1 ? isOddInOddRadix : digit & 1))) {
243 fraction *= radix;
246 // Keep track whether the portion written is currently even, if the radix is odd.
250 // Shift the fractions by radix.
251 halfDeltaNext *= radix;
252 halfDeltaLast *= radix;
261 if (dComparePoint5 > 0 || (!dComparePoint5 && (radix & 1 ? isOddInOddRadix : digit & 1))) {
270 fraction *= radix;
276 halfDelta *= radix;
282 // Whilst the last digit is the maximum in the current radix, remove it.
285 while (endOfResultString[-1] == radixDigits[radix - 1])
325 // Divide by radix to remove one digit from the value.
326 digit = units.divide(radix);
338 static String toStringWithRadix(int32_t number, unsigned radix)
340 LChar buf[1 + 32]; // Worst case is radix == 2, which gives us 32 digits + sign.
352 uint32_t index = positiveNumber % radix;
355 positiveNumber /= radix;
493 int32_t radix;
495 radix = radixValue.asInt32();
497 radix = 10;
499 radix = static_cast<int32_t>(radixValue.toInteger(exec)); // nan -> 0
501 return radix;
504 static inline EncodedJSValue integerValueToString(ExecState* exec, int32_t radix, int32_t value)
506 // A negative value casted to unsigned would be bigger than 36 (the max radix).
507 if (static_cast<unsigned>(value) < static_cast<unsigned>(radix)) {
514 if (radix == 10) {
519 return JSValue::encode(jsString(exec, toStringWithRadix(value, radix)));
529 int32_t radix = extractRadixFromArgs(exec);
530 if (radix < 2 || radix > 36)
531 return throwVMError(exec, createRangeError(exec, ASCIILiteral("toString() radix argument must be between 2 and 36")));
535 return integerValueToString(exec, radix, integerValue);
537 if (radix == 10) {
546 return JSValue::encode(jsString(exec, toStringWithRadix(s, doubleValue, radix)));