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

Quelle  bug1897792.js

  Sprache: JAVA
 

function drawGrid() {
  var n = 32;
  var gridVertices = [];
  var gridColors = [];
  var gridSecColors = [];
  var currentVertex = 0;
  var currentColor = 0;
  var currentSecColor = 0;
  var z = -2.0;
  for (var i = -n; i < n; ++i) {
    var x1 = i / n;
    var x2 = (i + 1) / n;
    for (var j = -n; j < n; ++j) {
      var y1 = j / n;
      var y2 = (j + 1) / n;
      gridVertices[currentVertex++] = x1;
      gridVertices[currentVertex++] = y1;
      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
      gridColors[currentColor++] = (x1 + 1.0) / 2.0;
      gridColors[currentColor++] = (y1 + 1.0) / 2.0;
      gridSecColors[currentSecColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
      gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0;
      gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0;

      gridVertices[currentVertex++] = x2;
      gridVertices[currentVertex++] = y1;
      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x2 + y1 + 2.0) / 4.0;
      gridColors[currentColor++] = (x2 + 1.0) / 2.0;
      gridColors[currentColor++] = (y1 + 1.0) / 2.0;
      gridSecColors[currentSecColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0;
      gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0;
      gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0;

      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
      gridColors[currentColor++] = (x2 + 1.0) / 2.0;
      gridColors[currentColor++] = (y2 + 1.0) / 2.0;
      gridSecColors[currentSecColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
      gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0;

      gridVertices[currentVertex++] = x2;
      gridVertices[currentVertex++] = y2;
      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
      gridColors[currentColor++] = (x2 + 1.0) / 2.0;
      gridColors[currentColor++] = (y2 + 1.0) / 2.0;

      gridVertices[currentVertex++] = x1;
      gridVertices[currentVertex++] = y2;
      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0;
      gridColors[currentColor++] = (x1 + 1.0) / 2.0;
      gridColors[currentColor++] = (y2 + 1.0) / 2.0;

      gridVertices[currentVertex++] = x1;
      gridVertices[currentVertex++] = y1;
      gridVertices[currentVertex++] = z;
      gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
    }
  }
  return gridColors;
}
function test() {
  var arr = drawGrid();
  var res = 0;
  for (var i = 0; i < arr.length; i++) {
    res += arr[i];
  }
  assertEq(res, 32832);
}
test();

Messung V0.5 in Prozent
C=94 H=69 G=82

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© 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.