summaryrefslogtreecommitdiff
path: root/js/Linear/SUMMATION.js
diff options
context:
space:
mode:
authorSunil Shetye2018-07-18 15:33:44 +0530
committerSunil Shetye2018-07-18 17:07:40 +0530
commit4d1e8bb193a7315a8fcfe1e09c33befdee660b7d (patch)
tree360c93b86402e468a69d22fe3187d0809b095587 /js/Linear/SUMMATION.js
parentbfa780421678e897b17680f3e7c5db72d8ea8375 (diff)
downloadsci2js-4d1e8bb193a7315a8fcfe1e09c33befdee660b7d.tar.gz
sci2js-4d1e8bb193a7315a8fcfe1e09c33befdee660b7d.tar.bz2
sci2js-4d1e8bb193a7315a8fcfe1e09c33befdee660b7d.zip
add throw after message()
Diffstat (limited to 'js/Linear/SUMMATION.js')
-rw-r--r--js/Linear/SUMMATION.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/Linear/SUMMATION.js b/js/Linear/SUMMATION.js
index 6ad993ed..6ab823b6 100644
--- a/js/Linear/SUMMATION.js
+++ b/js/Linear/SUMMATION.js
@@ -45,11 +45,13 @@ function SUMMATION() {
this.sgn = this.sgn.slice();
if ((this.satur!=0&&this.satur!=1&&this.satur!=2)) {
message("Do on overflow must be 0,1,2");
+ throw "user error";
var ok = false;
}
if (size(this.sgn,1)==1) {
if (this.sgn<1) {
message("Number of inputs must be > 0");
+ throw "user error";
var ok = false;
} else if (this.sgn==1) {
var in1 = -1;
@@ -67,6 +69,7 @@ function SUMMATION() {
} else {
if (!and(abs(this.sgn)==1)) {
message("Signs can only be +1 or -1");
+ throw "user error";
var ok = false;
} else {
var in1 = -ones(size(this.sgn,1),1);
@@ -83,6 +86,7 @@ function SUMMATION() {
this.model.sim = list(new ScilabString(["summation_z"]), new ScilabDouble([4]));
} else if (((this.Datatype<1)||(this.Datatype>8))) {
message("Datatype is not supported");
+ throw "user error";
var ok = false;
} else {
if (this.satur==0) {