summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/nansum/znansuma.c
diff options
context:
space:
mode:
authorAbhinav Dronamraju2017-07-29 02:28:04 +0530
committerAbhinav Dronamraju2017-07-29 02:28:04 +0530
commite3630a1a245b9b7a2aba285a242bea200398ff6a (patch)
tree69d61880832b9a8ff01727f9d6ad0498675a53c4 /src/c/elementaryFunctions/nansum/znansuma.c
parentddd322c2eca9f67013a6bc67a798f7a9978cd1d0 (diff)
downloadscilab2c-e3630a1a245b9b7a2aba285a242bea200398ff6a.tar.gz
scilab2c-e3630a1a245b9b7a2aba285a242bea200398ff6a.tar.bz2
scilab2c-e3630a1a245b9b7a2aba285a242bea200398ff6a.zip
nansum added
Diffstat (limited to 'src/c/elementaryFunctions/nansum/znansuma.c')
-rw-r--r--src/c/elementaryFunctions/nansum/znansuma.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/nansum/znansuma.c b/src/c/elementaryFunctions/nansum/znansuma.c
new file mode 100644
index 00000000..cb839f02
--- /dev/null
+++ b/src/c/elementaryFunctions/nansum/znansuma.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "nansum.h"
+#include "types.h"
+#include "doubleComplex.h"
+#include "addition.h"
+
+doubleComplex znansuma(doubleComplex *in, int size)
+{
+ doubleComplex fin=0;
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+ if(!(isnan(zreals(in[i]))) && !(isnan(zimags(in[i]))))
+ {
+ fin= zadds(fin, in[i]);
+
+ }
+
+
+ }
+
+ return fin;
+}