Open GoogleCodeExporter opened 9 years ago
Sorry,
I pasted an old test
this is the correct one:)
function rM(sum){
var sS = sum.toString().replace("0.","");
var sSA=[];
for (var ii=0;ii<sS.length;ii++){
sSA.push(parseInt(sS.substring(ii,ii+1)));
}
for (ii=sSA.length;ii>5;ii--){
if(sum<1){
sS="0.";
if(sSA[ii]>=5){
for(var q=0;q<ii-1;q++){
sS+="0";
}
sS+="1";
sum+=parseFloat(sS);
}
}else{
break;
}
}
return sum;
}
function matrixMultiply(m1, m2) {
var result = createMatrixIdentity();
for (var x = 0; x < 3; x++) {
for (var y = 0; y < 3; y++) {
var sum = 0;
for (var z = 0; z < 3; z++) {
sum += m1[x][z] * m2[z][y];
if (sum>0 && sum<1){
sum=rM(sum);
}
}
result[x][y] = sum;
}
}
return result;
}
Original comment by sl8...@gmail.com
on 6 Apr 2009 at 8:16
Original issue reported on code.google.com by
sl8...@gmail.com
on 6 Apr 2009 at 6:22