diff options
-rw-r--r-- | src/c/auxiliaryFunctions/isnan/sisnans.c | 44 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/isnan/testIsNan.c | 24 | ||||
-rw-r--r-- | src/c/implicitList/dimplicitLists.c | 4 |
3 files changed, 36 insertions, 36 deletions
diff --git a/src/c/auxiliaryFunctions/isnan/sisnans.c b/src/c/auxiliaryFunctions/isnan/sisnans.c index 07d56538..201fd31a 100644 --- a/src/c/auxiliaryFunctions/isnan/sisnans.c +++ b/src/c/auxiliaryFunctions/isnan/sisnans.c @@ -1,23 +1,23 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET - * - * 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 - * - */ - -#ifdef _MSC_VER -#include <float.h> +/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
+ *
+ * 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
+ *
+ */
+
+#ifdef _MSC_VER
+#include <float.h>
#define isnan(x) _isnan((double)x)
-#endif - -#include "isnan.h" - -float sisnans(float in) { - return isnan(in) ? (float)1 :(float)0; -} - +#endif
+
+#include "isnan.h"
+
+float sisnans(float in) {
+ return isnan(in) ? (float)1 :(float)0;
+}
+
diff --git a/src/c/auxiliaryFunctions/isnan/testIsNan.c b/src/c/auxiliaryFunctions/isnan/testIsNan.c index 01922c2e..6e14cd5b 100644 --- a/src/c/auxiliaryFunctions/isnan/testIsNan.c +++ b/src/c/auxiliaryFunctions/isnan/testIsNan.c @@ -23,13 +23,13 @@ int sisnansTest() { float full = 1.23456789f; printf(">> Float \n"); - if (sisnans(nan) == false) { + if ((bool)sisnans(nan) == false) { printf("ERROR ! : Test Failed (Must be nan)\n"); result = ERROR; } assert (sisnans(nan) == true); - if (sisnans(full) == true) { + if ((bool)sisnans(full) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } @@ -46,13 +46,13 @@ int disnansTest() { double full = 1.456789321861; printf(">> Double\n"); - if (disnans(nan) == false) { + if ((bool)disnans(nan) == false) { printf("ERROR ! : Test Failed (Must be nan)\n"); result = ERROR; } assert(disnans(nan) == true); - if (disnans(full) == true) { + if ((bool)disnans(full) == true) { printf("ERROR ! : Test Failed (non nan array)\n"); result = ERROR; } @@ -71,25 +71,25 @@ int cisnansTest() { floatComplex full = FloatComplex(0.0f,1.0f); printf(">> Float Complex\n"); - if (cisnans(nan_nan) == false) { + if ((bool)cisnans(nan_nan) == false) { printf("ERROR ! : Test Failed (Must be nan)\n"); result = ERROR; } assert (cisnans(nan_nan) == true); - if (cisnans(nan_real) == true) { + if ((bool)cisnans(nan_real) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } assert(cisnans(nan_real) == false); - if (cisnans(real_nan) == true) { + if ((bool)cisnans(real_nan) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } assert(cisnans(real_nan) == false); - if (cisnans(full) == true) { + if ((bool)cisnans(full) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } @@ -109,25 +109,25 @@ int zisnansTest() { floatComplex full = FloatComplex(0.0f,1.0f); printf(">> Double Complex\n"); - if (cisnans(nan_nan) == false) { + if ((bool)cisnans(nan_nan) == false) { printf("ERROR ! : Test Failed (Must be nan)\n"); result = ERROR; } assert (cisnans(nan_nan) == true); - if (cisnans(nan_real) == true) { + if ((bool)cisnans(nan_real) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } assert(cisnans(nan_real) == false); - if (cisnans(real_nan) == true) { + if ((bool)cisnans(real_nan) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } assert(cisnans(real_nan) == false); - if (cisnans(full) == true) { + if ((bool)cisnans(full) == true) { printf("ERROR ! : Test Failed (Must not be nan)\n"); result = ERROR; } diff --git a/src/c/implicitList/dimplicitLists.c b/src/c/implicitList/dimplicitLists.c index 1c7753f8..a06f91e1 100644 --- a/src/c/implicitList/dimplicitLists.c +++ b/src/c/implicitList/dimplicitLists.c @@ -21,7 +21,7 @@ void dimplicitLists(double start, double step, double end, double *out) { if (start < start + step) { - iNbElements = floor((end - start) / step) + 1; + iNbElements = (int)(floor((end - start) / step) + 1); out[0] = start; } } @@ -29,7 +29,7 @@ void dimplicitLists(double start, double step, double end, double *out) { if (start > start + step) { - iNbElements = floor((start - end) / step) + 1; + iNbElements = (int)(floor((start - end) / step) + 1); out[0] = start; } } |