浮点数运算结果精度不正确

问题遇到的现象和发生背景

img

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

double zhishu2(double j,double a){
    double res;
    while(j<0){
        a/=8;
        j++;
    }
    return res;
}
int main() {
    int T,i,j,x,k,y,a;
    double o,result;
    char num[50];
    scanf("%d",&T);//问题数
    for(i=0;i<T;i++){
        scanf("%s",num);
        j=2;k=-1;result=0;
        while(num[j]!='\0'){
            a=num[j]-'0';
            result+=zhishu2(k,a);                
            j++;k--;
        }
        printf("case #%d:\n%.*lf\n",i,3(j-2),result);
    } 
    return 0;
}

使用高精度函数库