Scala 2.9 中的标准十进制类型是什么?

发布于 2024-12-19 13:40:03 字数 96 浏览 3 评论 0原文

Scala 与 C# 的 decimal 的相似之处是什么?我应该使用 java.math.BigDecimal 还是 Scala 中有自己的标准类型?

What is the Scala's analogue to C#'s decimal? Should I use java.math.BigDecimal or is there own standard type for this in Scala?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许一世地老天荒 2024-12-26 13:40:03

scala.math。 BigDecimal 已在 Predef 中导入。这只是 java.math.BigDecimal 的包装,它使用方法的运算符名称(例如 + 而不是 add)。

There is scala.math.BigDecimal which is already imported in Predef. This is only a wrapper around java.math.BigDecimal that uses operator names for methods (like e.g. + instead of add).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文