询问者
再建一个结构体,也是数字,怎么与其他数进行加减乘除?

问题
全部回复
-
起初,我在写小数换写成分数的函数,
ulong[] Fr(ulong num ,byte loop); //把小数写成整数 //loop是从右往左,循环位数
我随机用23/97,20位小数都没有循环的迹象,我想位数不够。
新建一种数的想法就有了。
public struct Digit{ private ulong[] Bits8;//只用来表示小数 }
如何与其他数加减乘除?
你好 czhch,
请问您想做得事情是什么?
您能解释一下您得备注和您遇到得错误吗?有没有实际操作?
您得小数与其它数加减乘除,是指和什么类型得数呢?
经过我们得讨论,我们不太理解您想要完成的工作。
Best Regards,
Jiale
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
您好 czhch,
您说得怎么存入内存是什么意思?
您对This的定义是什么?Bits64[0]又是什么?
从您的代码来看,如果想保存,不能这样做吗?
if(this-Math.Pow(2,-(u+1))>0){
Bits64[0]+=Math.Pow(2,63-u);
}else{
var result=Bits64[0];
}Best Regards,
Jiale
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.