Etwas seltsam mit Uint32 Mathematik:Javascript uint32 Mathe funktioniert nicht?
a = new Uint32Array([1103515245, 1103527590, 0]);
a[2] = a[0] * a[1];
console.log(a[2]);
2524872960 Gibt, die ich denke, weil in C falsch ist:
#include <stdio.h>
int main() {
unsigned a[3] = { 1103515245, 1103527590, 0 };
a[2] = a[0] * a[1];
printf("%u\n", a[2]);
return 0;
}
Gibt 2524872878 (und tut dies Windows-Rechner)
Also, was ist damit fertig? Ich benutze Firefox 45.0.1
EDIT: Oh, und wenn das erwartet wird, wie kann ich dann das "C" Ergebnis duplizieren?
Ah, viel besser danke. – user9645