Fluid
  • 首页
  • 归档
  • 分类
  • 标签
  • 关于
  •   
  •   

BigDecimal运算封装

BigDecimal 介绍BigDecimal 可以实现对浮点数的运算,不会造成精度丢失。通常情况下,大部分需要浮点数精确运算结果的业务场景(比如涉及到钱的场景)都是通过 BigDecimal 来做的。 纳尼,浮点数的运算竟然还会有精度丢失的风险吗?确实会! 示例代码: 12345float a = 2.0f - 1.9f;float b = 1.8f - 1.7f;System.out.prin
2022-08-26
Java
#Java

Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick
2022-08-26
12

搜索

Hexo Fluid