summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/fix
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions/fix')
-rw-r--r--src/c/elementaryFunctions/fix/i16fixa.c21
-rw-r--r--src/c/elementaryFunctions/fix/i16fixs.c19
-rw-r--r--src/c/elementaryFunctions/fix/i8fixa.c19
-rw-r--r--src/c/elementaryFunctions/fix/i8fixs.c21
-rw-r--r--src/c/elementaryFunctions/fix/u16fixa.c19
-rw-r--r--src/c/elementaryFunctions/fix/u16fixs.c21
-rw-r--r--src/c/elementaryFunctions/fix/u8fixa.c19
-rw-r--r--src/c/elementaryFunctions/fix/u8fixs.c21
8 files changed, 160 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/fix/i16fixa.c b/src/c/elementaryFunctions/fix/i16fixa.c
new file mode 100644
index 00000000..07cd75b0
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/i16fixa.c
@@ -0,0 +1,21 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+#include "floor.h"
+#include "ceil.h"
+
+void i16fixa(int16* x, int size, int16* out) {
+ int i = 0;
+ for (i=0;i<size;i++) out[i] = i16fixs(x[i]);
+}
diff --git a/src/c/elementaryFunctions/fix/i16fixs.c b/src/c/elementaryFunctions/fix/i16fixs.c
new file mode 100644
index 00000000..f133d8a3
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/i16fixs.c
@@ -0,0 +1,19 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+
+int16 i16fixs(int16 x) {
+ if (x>=0) return i16floors(x);
+ else return i16ceils(x);
+}
diff --git a/src/c/elementaryFunctions/fix/i8fixa.c b/src/c/elementaryFunctions/fix/i8fixa.c
new file mode 100644
index 00000000..bb20f2d3
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/i8fixa.c
@@ -0,0 +1,19 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+
+void i8fixa(int8* x, int size, int8* out) {
+ int i = 0;
+ for (i=0;i<size;i++) out[i] = i8fixs(x[i]);
+}
diff --git a/src/c/elementaryFunctions/fix/i8fixs.c b/src/c/elementaryFunctions/fix/i8fixs.c
new file mode 100644
index 00000000..adeb3dd0
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/i8fixs.c
@@ -0,0 +1,21 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+#include "floor.h"
+#include "ceil.h"
+
+int8 i8fixs(int8 x) {
+ if (x>=0) return i8floors(x);
+ else return i8ceils(x);
+}
diff --git a/src/c/elementaryFunctions/fix/u16fixa.c b/src/c/elementaryFunctions/fix/u16fixa.c
new file mode 100644
index 00000000..acddf8df
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/u16fixa.c
@@ -0,0 +1,19 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+
+void u16fixa(uint16* x, int size, uint16* out) {
+ int i = 0;
+ for (i=0;i<size;i++) out[i] = u16fixs(x[i]);
+}
diff --git a/src/c/elementaryFunctions/fix/u16fixs.c b/src/c/elementaryFunctions/fix/u16fixs.c
new file mode 100644
index 00000000..1ff7a8a5
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/u16fixs.c
@@ -0,0 +1,21 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+#include "floor.h"
+#include "ceil.h"
+
+uint16 u16fixs(uint16 x) {
+ if (x>=0) return u16floors(x);
+ else return u16ceils(x);
+}
diff --git a/src/c/elementaryFunctions/fix/u8fixa.c b/src/c/elementaryFunctions/fix/u8fixa.c
new file mode 100644
index 00000000..c86545b9
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/u8fixa.c
@@ -0,0 +1,19 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+
+void u8fixa(uint8* x, int size, uint8* out) {
+ int i = 0;
+ for (i=0;i<size;i++) out[i] = u8fixs(x[i]);
+}
diff --git a/src/c/elementaryFunctions/fix/u8fixs.c b/src/c/elementaryFunctions/fix/u8fixs.c
new file mode 100644
index 00000000..c7740045
--- /dev/null
+++ b/src/c/elementaryFunctions/fix/u8fixs.c
@@ -0,0 +1,21 @@
+/* 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: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <math.h>
+#include "fix.h"
+#include "floor.h"
+#include "ceil.h"
+
+uint8 u8fixs(uint8 x) {
+ if (x>=0) return u8floors(x);
+ else return u8ceils(x);
+}