new file: resources/bytecode/javFiles/Scalar.jav

This commit is contained in:
pl@gohorb.ba-horb.de 2023-04-04 15:54:41 +02:00
parent 86d229cac9
commit f6fe3a68aa

View File

@ -0,0 +1,26 @@
import java.util.Vector;
import java.lang.Integer;
import java.lang.Float;
//import java.lang.Byte;
//import java.lang.Boolean;
public class Scalar extends Vector<Integer> {
Scalar(v) {
Integer i;
i = 0;
while(i < v.size()) {
this.add(v.elementAt(i));
i=i+1;
}
}
mul(v) {
var ret = 0;
var i = 0;
while(i < size()) {
ret = ret + this.elementAt(i) * v.elementAt(i);
}
return ret;
}
}