#include<stdio.h>
#include<math.h>
void main()
{
double a,b,num,result,smalla,smallb,small;
int A,B,count;
printf("请定义a与b的值中间用逗号隔开\n");
scanf("%lf,%lf",&a,&b);
A=(int)a;
B=(int)b;
count=B;
num=0;
do
{
count/=10;
num++;
}while(count);
smalla=a-A+0.00000000001;
smallb=b-B;
small=smalla; A=A*pow(10,num);
result=A+B+smalla;
num=0;
do
{
num++;
small=small*10;
count=(int)small;
}while((small-count)>0.0000001);
smallb=smallb*pow(10,-num);
result=result+smallb;
printf("%lf",result);
}
闲得无聊,编的一种把两组数据组合的程序
最新推荐文章于 2021-05-23 20:03:59 发布
本文介绍了一种用于浮点数高精度加法的算法,通过将输入值转换为整数并进行对齐操作,实现小数点位置的精确对齐,从而达到高精度计算的目的。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
图片生成
Stable-Diffusion
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
6万+

被折叠的 条评论
为什么被折叠?



