IDEA 告警Unpredictable ‘new BigDecimal()‘ call

简介: IDEA 告警Unpredictable ‘new BigDecimal()‘ call

通知调用接受double值的 BigDecimal 构造器。这些构造器生成一个 BigDecimal,它完全等于提供的double值。但是,由于double编码为 IEEE 754 64 位双精度二进制浮点格式,因此精确的值可能会出人意料。

例如,new BigDecimal(0.1) 生成一个 BigDecimal,其值为 0.10000000000000551115151572702702181583404541015625,这是最接近数字 0.1 的 double。要获取存储与源代码中写入的值相同的 BigDecimal,请使用new BigDecimal(“0.1”) 或 BigDecimal.valueOf(0.1).


目录
相关文章
IDEA 使用 lombak 时的一个小警告:Generating equals/hashCode implementation but without a call to superclass
今日在IDEA中使用Lombok时遇到@Data注解的黄色警告,提示equals和hashCode未调用父类方法。虽不影响运行,但影响美观。可通过@EqualsAndHashCode(callSuper = true)或在lombok.config中配置默认行为解决,推荐后者统一管理,彻底消除警告。
IDEA告警详解:Optional.isPresent can be replaced with functional-style expression
类似 if(Optional.isPresent()) 的条件语句,可以被重写成函数式风格。
205 0
IDEA告警详解:Optional.isPresent can be replaced with functional-style expression
|
Java 数据库
IDEA不能运行 Add Configuration/Press the + button to create a new Configuration which cannot be loaded
IDEA不能运行 Add Configuration/Press the + button to create a new Configuration which cannot be loaded
IDEA不能运行 Add Configuration/Press the + button to create a new Configuration which cannot be loaded
|
存储 缓存 Java
IDEA告警:Unnecessary unboxing ‘xxx.intValue()‘
显式编码拆箱已包装的原始数值。在Java5及以上的版本,拆箱是不必要的,可以安全地删除。那么 JDK5 到底做了啥
250 0
idea:new没有class 解决方案
idea:new没有class 解决方案
203 0
|
Java 应用服务中间件
idea文件右键创建New没有Create New Servlet的解决办法
idea文件右键创建New没有Create New Servlet的解决办法
idea文件右键创建New没有Create New Servlet的解决办法
|
Java Maven 开发工具
2020-3版本的idea那些选项去哪了呢(例如:Othere Settings、Create New Servlet等等)
2020-3版本的idea那些选项去哪了呢(例如:Othere Settings、Create New Servlet等等)
662 0
2020-3版本的idea那些选项去哪了呢(例如:Othere Settings、Create New Servlet等等)
|
缓存 Java Maven
IDEA 告警:Library source does not match the bytecode for class
IDEA 告警:Library source does not match the bytecode for class
1763 0
IDEA 告警:Library source does not match the bytecode for class
取消IDEA的Autowired对字段注解告警
取消IDEA的Autowired对字段注解告警
233 0
取消IDEA的Autowired对字段注解告警
|
API
IDEA告警:Can be replaced with ‘.values().stream()‘
IDEA告警:Can be replaced with ‘.values().stream()‘
577 0
IDEA告警:Can be replaced with ‘.values().stream()‘