From b43eccd4cffed5bd1017c5821524fb6e49202f78 Mon Sep 17 00:00:00 2001 From: Sandeep Gupta Date: Sun, 18 Jun 2017 23:55:40 +0530 Subject: First commit --- .../radix_conversions/oct2dec/doct2deca.c | 21 ++++++++++++++ .../radix_conversions/oct2dec/doct2decs.c | 32 ++++++++++++++++++++++ .../radix_conversions/oct2dec/i16oct2deca.c | 21 ++++++++++++++ .../radix_conversions/oct2dec/i16oct2decs.c | 32 ++++++++++++++++++++++ .../radix_conversions/oct2dec/i8oct2deca.c | 21 ++++++++++++++ .../radix_conversions/oct2dec/i8oct2decs.c | 32 ++++++++++++++++++++++ .../radix_conversions/oct2dec/u16oct2deca.c | 21 ++++++++++++++ .../radix_conversions/oct2dec/u16oct2decs.c | 32 ++++++++++++++++++++++ .../radix_conversions/oct2dec/u8oct2deca.c | 21 ++++++++++++++ .../radix_conversions/oct2dec/u8oct2decs.c | 32 ++++++++++++++++++++++ 10 files changed, 265 insertions(+) create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/doct2deca.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/doct2decs.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i16oct2deca.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i16oct2decs.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i8oct2deca.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i8oct2decs.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u16oct2deca.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u16oct2decs.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u8oct2deca.c create mode 100644 2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u8oct2decs.c (limited to '2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec') diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/doct2deca.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/doct2deca.c new file mode 100644 index 00000000..e3619eb3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/doct2deca.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Shamik Guha + Email: toolbox@scilab.in +*/ +#include "oct2dec.h" + +void doct2deca(double* in,int size,double* out) +{ + int i=0; + for(i=0;i +#include "oct2dec.h" +#include +#include + +double doct2decs(double in) +{ + int n=0,rem=0, base=1; + double out=0.0; + n=(int)in; + while (n!=0) + { + rem = n%10; + out = out + (rem * base); + n = n / 10 ; + base = base * 8; + } + return out; +} + + diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i16oct2deca.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i16oct2deca.c new file mode 100644 index 00000000..9db3e2e1 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i16oct2deca.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Shamik Guha + Email: toolbox@scilab.in +*/ +#include "oct2dec.h" + +void i16oct2deca(int16* in,int size,int16* out) +{ + int i=0; + for(i=0;i +#include "oct2dec.h" +#include +#include + +int16 i16oct2decs(int16 in) /* Function to convert octal to decimal */ +{ + int n=0,rem=0, base=1; + int16 out=0; + n=(int)in; + while (n!=0) + { + rem = n%10; + out = out + (rem * base); + n = n / 10 ; + base = base * 8; + } + return out; +} + + diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i8oct2deca.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i8oct2deca.c new file mode 100644 index 00000000..de57a0ea --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/i8oct2deca.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Shamik Guha + Email: toolbox@scilab.in +*/ +#include "oct2dec.h" + +void i8oct2deca(int8* in,int size,int8* out) +{ + int i=0; + for(i=0;i +#include "oct2dec.h" +#include +#include + +int8 i8oct2decs(int8 in) /* Function to convert octal to decimal */ +{ + int n=0,rem=0, base=1; + int8 out=0; + n=(int)in; + while (n!=0) + { + rem = n%10; + out = out + (rem * base); + n = n / 10 ; + base = base * 8; + } + return out; +} + + diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u16oct2deca.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u16oct2deca.c new file mode 100644 index 00000000..7778ee96 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u16oct2deca.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Shamik Guha + Email: toolbox@scilab.in +*/ +#include "oct2dec.h" + +void u16oct2deca(uint16* in,int size,uint16* out) +{ + int i=0; + for(i=0;i +#include "oct2dec.h" +#include +#include + +uint16 u16oct2decs(uint16 in) /* Function to convert octal to decimal */ +{ + int n=0,rem=0, base=1; + uint16 out=0; + n=(int)in; + while (n!=0) + { + rem = n%10; + out = out + (rem * base); + n = n / 10 ; + base = base * 8; + } + return out; +} + + diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u8oct2deca.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u8oct2deca.c new file mode 100644 index 00000000..d1880203 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/oct2dec/u8oct2deca.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Shamik Guha + Email: toolbox@scilab.in +*/ +#include "oct2dec.h" + +void u8oct2deca(uint8* in,int size,uint8* out) +{ + int i=0; + for(i=0;i +#include "oct2dec.h" +#include +#include + +uint8 u8oct2decs(uint8 in) /* Function to convert octal to decimal */ +{ + int n=0,rem=0, base=1; + uint8 out=0; + n=(int)in; + while (n!=0) + { + rem = n%10; + out = out + (rem * base); + n = n / 10 ; + base = base * 8; + } + return out; +} + + -- cgit