summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c')
-rw-r--r--2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c b/2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c
new file mode 100644
index 00000000..4b0bd592
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/radix_conversions/dec2oct/u16dec2octs.c
@@ -0,0 +1,27 @@
+#include <string.h>
+#include <math.h>
+#include "dec2oct.h"
+#include <stdio.h>
+
+void u16dec2octs(uint16 in,uint16* out)
+{
+ int i=0,j=0,tmp=0;
+ int quotient;
+ quotient=(int)in;
+ while(quotient!=0)
+ {
+ out[i++]= quotient%8;
+ quotient=quotient/8;
+ }
+ j=i-1;
+ i=0;
+
+ while(i<j)
+ {
+ tmp=out[i];
+ out[i]=out[j];
+ out[j]=tmp;
+ i++;
+ j--;
+ }
+}