diff options
author | siddhu8990 | 2015-09-03 02:07:40 +0530 |
---|---|---|
committer | siddhu8990 | 2015-09-03 02:07:40 +0530 |
commit | 9c9839e48297fc32a6d22a22c0f9fa879cf00d2d (patch) | |
tree | 05f4600f1674a2ca7d4d4410c36694a978a59458 /src/c/elementaryFunctions/fix | |
parent | 17892e4b25aa0488eb51a5896c58094d63b7c55c (diff) | |
download | Scilab2C_fossee_old-9c9839e48297fc32a6d22a22c0f9fa879cf00d2d.tar.gz Scilab2C_fossee_old-9c9839e48297fc32a6d22a22c0f9fa879cf00d2d.tar.bz2 Scilab2C_fossee_old-9c9839e48297fc32a6d22a22c0f9fa879cf00d2d.zip |
Intermediate commit. Not to be used
Diffstat (limited to 'src/c/elementaryFunctions/fix')
-rw-r--r-- | src/c/elementaryFunctions/fix/i16fixa.c | 21 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/i16fixs.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/i8fixa.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/i8fixs.c | 21 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/u16fixa.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/u16fixs.c | 21 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/u8fixa.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/fix/u8fixs.c | 21 |
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 0000000..2ccb933 --- /dev/null +++ b/src/c/elementaryFunctions/fix/i16fixa.c @@ -0,0 +1,21 @@ +/* + * 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 <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 0000000..5a13ca0 --- /dev/null +++ b/src/c/elementaryFunctions/fix/i16fixs.c @@ -0,0 +1,19 @@ +/* + * 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 <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 0000000..4e913a3 --- /dev/null +++ b/src/c/elementaryFunctions/fix/i8fixa.c @@ -0,0 +1,19 @@ +/* + * 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 <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 0000000..ae331ff --- /dev/null +++ b/src/c/elementaryFunctions/fix/i8fixs.c @@ -0,0 +1,21 @@ +/* + * 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 <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 0000000..5798300 --- /dev/null +++ b/src/c/elementaryFunctions/fix/u16fixa.c @@ -0,0 +1,19 @@ +/* + * 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 <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 0000000..cf17847 --- /dev/null +++ b/src/c/elementaryFunctions/fix/u16fixs.c @@ -0,0 +1,21 @@ +/* + * 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 <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 0000000..2a3bd3b --- /dev/null +++ b/src/c/elementaryFunctions/fix/u8fixa.c @@ -0,0 +1,19 @@ +/* + * 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 <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 0000000..563bfe9 --- /dev/null +++ b/src/c/elementaryFunctions/fix/u8fixs.c @@ -0,0 +1,21 @@ +/* + * 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 <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); +} |