summaryrefslogtreecommitdiff
path: root/src/auxiliaryFunctions/isnan
diff options
context:
space:
mode:
Diffstat (limited to 'src/auxiliaryFunctions/isnan')
-rw-r--r--src/auxiliaryFunctions/isnan/cisnana.c22
-rw-r--r--src/auxiliaryFunctions/isnan/cisnans.c5
-rw-r--r--src/auxiliaryFunctions/isnan/disnana.c22
-rw-r--r--src/auxiliaryFunctions/isnan/disnans.c4
-rw-r--r--src/auxiliaryFunctions/isnan/sisnana.c22
-rw-r--r--src/auxiliaryFunctions/isnan/sisnans.c4
-rw-r--r--src/auxiliaryFunctions/isnan/testIsNan.h8
-rw-r--r--src/auxiliaryFunctions/isnan/zisnana.c22
-rw-r--r--src/auxiliaryFunctions/isnan/zisnans.c2
9 files changed, 104 insertions, 7 deletions
diff --git a/src/auxiliaryFunctions/isnan/cisnana.c b/src/auxiliaryFunctions/isnan/cisnana.c
new file mode 100644
index 00000000..0048400a
--- /dev/null
+++ b/src/auxiliaryFunctions/isnan/cisnana.c
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include "isnan.h"
+
+
+void cisnana(floatComplex* in, int size, float* out){
+ int i=0;
+
+ for (i=0;i<size;i++) out[i] = cisnans(in[i]);
+
+}
+
diff --git a/src/auxiliaryFunctions/isnan/cisnans.c b/src/auxiliaryFunctions/isnan/cisnans.c
index 6594499c..527ff21a 100644
--- a/src/auxiliaryFunctions/isnan/cisnans.c
+++ b/src/auxiliaryFunctions/isnan/cisnans.c
@@ -12,6 +12,7 @@
#include "isnan.h"
-bool cisnans(floatComplex in) {
- return (isnan(creals(in)) || isnan(cimags(in)));
+float cisnans(floatComplex in) {
+ if ((int)(isnan(creals(in))) && (int)(isnan(cimags(in)))) return 1;
+ return 0;
}
diff --git a/src/auxiliaryFunctions/isnan/disnana.c b/src/auxiliaryFunctions/isnan/disnana.c
new file mode 100644
index 00000000..ad556fd8
--- /dev/null
+++ b/src/auxiliaryFunctions/isnan/disnana.c
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include "isnan.h"
+
+
+void disnana(double* in, int size, double* out){
+ int i=0;
+
+ for (i=0;i<size;i++) out[i] = disnans(in[i]);
+
+}
+
diff --git a/src/auxiliaryFunctions/isnan/disnans.c b/src/auxiliaryFunctions/isnan/disnans.c
index b8746100..981cbae4 100644
--- a/src/auxiliaryFunctions/isnan/disnans.c
+++ b/src/auxiliaryFunctions/isnan/disnans.c
@@ -12,7 +12,7 @@
#include "isnan.h"
-bool disnans(double in) {
- return isnan(in);
+double disnans(double in) {
+ return isnan(in) ? 1 : 0;
}
diff --git a/src/auxiliaryFunctions/isnan/sisnana.c b/src/auxiliaryFunctions/isnan/sisnana.c
new file mode 100644
index 00000000..31574376
--- /dev/null
+++ b/src/auxiliaryFunctions/isnan/sisnana.c
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include "isnan.h"
+
+
+void sisnana(float* in, int size, float* out){
+ int i=0;
+
+ for (i=0;i<size;i++) out[i] = sisnans(in[i]);
+
+}
+
diff --git a/src/auxiliaryFunctions/isnan/sisnans.c b/src/auxiliaryFunctions/isnan/sisnans.c
index fd561c71..cd646cd8 100644
--- a/src/auxiliaryFunctions/isnan/sisnans.c
+++ b/src/auxiliaryFunctions/isnan/sisnans.c
@@ -12,7 +12,7 @@
#include "isnan.h"
-bool sisnans(float in) {
- return isnan(in);
+float sisnans(float in) {
+ return isnan(in) ? (float)1 :(float)0;
}
diff --git a/src/auxiliaryFunctions/isnan/testIsNan.h b/src/auxiliaryFunctions/isnan/testIsNan.h
index 9bcc4306..ee34db84 100644
--- a/src/auxiliaryFunctions/isnan/testIsNan.h
+++ b/src/auxiliaryFunctions/isnan/testIsNan.h
@@ -27,6 +27,14 @@ int cisnansTest(void);
int zisnansTest(void);
+int sisnanaTest(void);
+
+int disnanaTest(void);
+
+int cisnanaTest(void);
+
+int zisnanaTest(void);
+
int testIsNan(void);
#endif /* ! __TESTISNAN_H__ */
diff --git a/src/auxiliaryFunctions/isnan/zisnana.c b/src/auxiliaryFunctions/isnan/zisnana.c
new file mode 100644
index 00000000..a6a65596
--- /dev/null
+++ b/src/auxiliaryFunctions/isnan/zisnana.c
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include "isnan.h"
+
+
+void zisnana(doubleComplex* in, int size, double* out){
+ int i=0;
+
+ for (i=0;i<size;i++) out[i] = zisnans(in[i]);
+
+}
+
diff --git a/src/auxiliaryFunctions/isnan/zisnans.c b/src/auxiliaryFunctions/isnan/zisnans.c
index 72964356..a2b1a0a4 100644
--- a/src/auxiliaryFunctions/isnan/zisnans.c
+++ b/src/auxiliaryFunctions/isnan/zisnans.c
@@ -12,6 +12,6 @@
#include "isnan.h"
-bool zisnans(doubleComplex in) {
+double zisnans(doubleComplex in) {
return (isnan(zreals(in)) || isnan(zimags(in)));
}