blob: 8f9f0b65ef631bd93baaf8dde477a4e9232efdad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <string.h>
#include "oct2dec.h"
#include <stdio.h>
#include <math.h>
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;
}
|