如何将BigDecimal转换为指数形式?
如何将 BigDecimal 对象转换为使用指数形式的字符串表示形式?类似于:3.134e67
?我查看了 API,发现了 toEngineeringString()
但它没有给我我想要的东西。
How to convert BigDecimal object to a String representation that uses the exponential form? something like: 3.134e67
? I looked into the API and I found toEngineeringString()
but it does not give me what I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否阅读过 NumberFormat 文档,这是来自 DecimalFormat 的:
请参阅:http://docs.oracle.com /javase/1.4.2/docs/api/java/text/DecimalFormat.html
Have you read the NumberFormat documentation, this is from DecimalFormat:
See: http://docs.oracle.com/javase/1.4.2/docs/api/java/text/DecimalFormat.html
这对你有帮助吗?
Does this help you?
您在寻找这样的东西吗?
YY ^ XX (mod QQ)
当您开始使用 GIANT 数字时,您将需要使用模运算。
当像 RSA 算法那样生成大素数时,这变得特别有用。
这里介绍了模运算的基础知识:
http://www.brainjammer.com/math/modular-arithmetic/
Are you looking for something like this?
YY ^ XX (mod QQ)
When you start using GIANT numbers you will need to use modular arithmetic.
This becomes especially useful when generating large primes like in RSA algorithm.
The basics of modular arithmetic covered here:
http://www.brainjammer.com/math/modular-arithmetic/