summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions/round
diff options
context:
space:
mode:
authorsiddhu89902015-09-03 02:07:40 +0530
committersiddhu89902015-09-03 02:07:40 +0530
commitbb798dd246f6eeb17601b7022fada02d613f9e76 (patch)
tree0c20df41cb06dfc4a2ff9a67ed46a08bbecfade0 /2.3-1/src/c/elementaryFunctions/round
parent3704cdf7eb9551353ac9175aa10be444755b8e22 (diff)
downloadScilab2C-bb798dd246f6eeb17601b7022fada02d613f9e76.tar.gz
Scilab2C-bb798dd246f6eeb17601b7022fada02d613f9e76.tar.bz2
Scilab2C-bb798dd246f6eeb17601b7022fada02d613f9e76.zip
Intermediate commit. Not to be used
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/round')
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/i16rounda.c20
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/i16rounds.c23
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/i8rounda.c20
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/i8rounds.c23
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/u16rounda.c20
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/u16rounds.c23
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/u8rounda.c20
-rw-r--r--2.3-1/src/c/elementaryFunctions/round/u8rounds.c23
8 files changed, 172 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/round/i16rounda.c b/2.3-1/src/c/elementaryFunctions/round/i16rounda.c
new file mode 100644
index 00000000..5cacafae
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/i16rounda.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+void i16rounda(int16* x, int size, int16* out) {
+ int i=0;
+
+ for (i=0;i<size;i++) out[i]=i16rounds(x[i]);
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/i16rounds.c b/2.3-1/src/c/elementaryFunctions/round/i16rounds.c
new file mode 100644
index 00000000..95bd6098
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/i16rounds.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+int16 i16rounds(int16 x) {
+ int result;
+
+ if(x>=0) result = (int16)((float)x+0.5);
+ else result = (int16)((float)x-0.5);
+
+ return (int16)result;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/i8rounda.c b/2.3-1/src/c/elementaryFunctions/round/i8rounda.c
new file mode 100644
index 00000000..c47be512
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/i8rounda.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+void i8rounda(int8* x, int size, int8* out) {
+ int i=0;
+
+ for (i=0;i<size;i++) out[i]=i8rounds(x[i]);
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/i8rounds.c b/2.3-1/src/c/elementaryFunctions/round/i8rounds.c
new file mode 100644
index 00000000..f37d53c6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/i8rounds.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+int8 i8rounds(int8 x) {
+ int result;
+
+ if(x>=0) result = (int8)((float)x+0.5);
+ else result = (int8)((float)x-0.5);
+
+ return (int8)result;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/u16rounda.c b/2.3-1/src/c/elementaryFunctions/round/u16rounda.c
new file mode 100644
index 00000000..38c4b282
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/u16rounda.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+void u16rounda(uint16* x, int size, uint16* out) {
+ int i=0;
+
+ for (i=0;i<size;i++) out[i]=u16rounds(x[i]);
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/u16rounds.c b/2.3-1/src/c/elementaryFunctions/round/u16rounds.c
new file mode 100644
index 00000000..babda6db
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/u16rounds.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+uint16 u16rounds(uint16 x) {
+ int result;
+
+ if(x>=0) result = (uint16)((float)x+0.5);
+ else result = (uint16)((float)x-0.5);
+
+ return (uint16)result;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/u8rounda.c b/2.3-1/src/c/elementaryFunctions/round/u8rounda.c
new file mode 100644
index 00000000..e8f828dd
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/u8rounda.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+void u8rounda(uint8* x, int size, uint8* out) {
+ int i=0;
+
+ for (i=0;i<size;i++) out[i]=u8rounds(x[i]);
+}
diff --git a/2.3-1/src/c/elementaryFunctions/round/u8rounds.c b/2.3-1/src/c/elementaryFunctions/round/u8rounds.c
new file mode 100644
index 00000000..7e3da179
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/round/u8rounds.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-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 "round.h"
+
+uint8 u8rounds(uint8 x) {
+ int result;
+
+ if(x>=0) result = (uint8)((float)x+0.5);
+ else result = (uint8)((float)x-0.5);
+
+ return (uint8)result;
+}