C#无限显著小数位数(任意精度)没有Java [英] C# unlimited significant decimal digits (arbitrary precision) without java

查看:402
本文介绍了C#无限显著小数位数(任意精度)没有Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:结果
什么是java类等价的:BigDecimal的在c#






我知道在这个岗位:在C#中任意精度小数?说,使用java.math.BigDecimal的,但我没有安装J#。我将如何实现在C#中任意精度?我想用二进制字符串,但乘以二时,我可能会遇到一些麻烦。


解决方案

请参阅的what是java类等价的:在c#

您可以创建自己的BigDecimal所使用的BigInteger在幕后,保持轨道,其中小数点将需要。


Possible Duplicate:
what is the equivalent for java class : BigDecimal in c#

I know in this post: Arbitrary precision decimals in C#? says to use java.math.BigDecimal, but I don't have J# installed. How would I achieve arbitrary precision in C#? I was thinking of using binary strings but I may run into some trouble when multiplying the two.

解决方案

See what is the equivalent for java class : BigDecimal in c#

You could create your own BigDecimal that used BigInteger under the covers and kept track of where the decimal point would need to be.

这篇关于C#无限显著小数位数(任意精度)没有Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆