diff options
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/fix')
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/i16fixa.c | 21 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/i16fixs.c | 19 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/i8fixa.c | 19 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/i8fixs.c | 21 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/u16fixa.c | 19 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/u16fixs.c | 21 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/u8fixa.c | 19 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/fix/u8fixs.c | 21 |
8 files changed, 160 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/fix/i16fixa.c b/2.3-1/src/c/elementaryFunctions/fix/i16fixa.c new file mode 100644 index 00000000..2ccb9338 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/i16fixs.c b/2.3-1/src/c/elementaryFunctions/fix/i16fixs.c new file mode 100644 index 00000000..5a13ca04 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/i8fixa.c b/2.3-1/src/c/elementaryFunctions/fix/i8fixa.c new file mode 100644 index 00000000..4e913a3b --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/i8fixs.c b/2.3-1/src/c/elementaryFunctions/fix/i8fixs.c new file mode 100644 index 00000000..ae331ffb --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/u16fixa.c b/2.3-1/src/c/elementaryFunctions/fix/u16fixa.c new file mode 100644 index 00000000..57983002 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/u16fixs.c b/2.3-1/src/c/elementaryFunctions/fix/u16fixs.c new file mode 100644 index 00000000..cf178479 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/u8fixa.c b/2.3-1/src/c/elementaryFunctions/fix/u8fixa.c new file mode 100644 index 00000000..2a3bd3b2 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/fix/u8fixs.c b/2.3-1/src/c/elementaryFunctions/fix/u8fixs.c new file mode 100644 index 00000000..563bfe9a --- /dev/null +++ b/2.3-1/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); +} |