eguatech/egua

Refatorar verificação de parâmetros

lucaspompeun opened this issue · 0 comments

egua/src/lib/eguamat.js

Lines 206 to 218 in 5671a03

module.exports.vet = function(a,b) {
if (isNaN(a) || a === null)
throw new RuntimeError(
this.token,
"Você deve prover valores para vet(a,b)."
);
var data = Array.from(Array(1),() => new Array(b-a+1));
// the benefit from creating array this way is a.length = number of rows and a[0].length = number of columns
for (var i = 0; i < data[0].length; i++) {
data[0][i]= a + i;
}
return matrizn(data);
};