repo.or.cz
/
qtwebkit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Update ReadMe.md
[qtwebkit.git]
/
JSTests
/
microbenchmarks
/
double-pollution-putbyoffset.js
blob
b38acaae31b2e586e0ad488316883cd6506c5f3d
1
function foo(a, b) {
2
var c = (a + b) / 2;
3
var d = a - b;
4
for (var i = 0; i < 2; ++i) {
5
c *= d;
6
c += d;
7
c /= d;
8
}
9
return {a:c - d, b:d};
10
}
11
12
var result = 0;
13
var array = [7, 8];
14
for (var i = 0; i < 100000; ++i) {
15
var thingy = foo(5, 6);
16
result += thingy.a + array[2 + thingy.b];
17
}
18
19
if (result != 1650000) {
20
print("Bac result: " + result);
21
throw "Bad result: " + result;
22
}
23
24