Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/bigint/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 916 B image not shown  

Quelle  parse-literal.js

  Sprache: JAVA
 

// Valid radices for the BigInt constructor.
const radices = [
  {
    radix: 2,
    prefix: "0b",
  },
  {
    radix: 8,
    prefix: "0o",
  },
  {
    radix: 10,
    prefix: "",
  },
  {
    radix: 16,
    prefix: "0x",
  },
];

// Leading zeroes are ignored.
const zeroes = [
  """0""00",
];

// Generate BigInt literals with up to 200 digits to cover the case when the
// result has more than one BigInt::Digit.
function* literals(radix, prefix) {
  const digits = "0123456789abcdefghijklmnopqrstuvwxyz";
  assertEq(radix < digits.length, true);

  let n = 0n;
  let s = prefix;
  for (let i = 1; i <= 200; ++i) {
    let d = i % radix;
    n = n * BigInt(radix) + BigInt(d);
    s += digits[d];

    yield [s, n];
  }
}

for (let {radix, prefix} of radices) {
  for (let zero of zeroes) {
    for (let [s, n] of literals(radix, prefix + zero)) {
      assertEq(BigInt(s), n, `literal: "${s}"`);
    }
  }
}

Messung V0.5 in Prozent
C=92 H=12 G=65

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.