当前位置:网站首页>Record a list object traversal and determine the size of the float type
Record a list object traversal and determine the size of the float type
2022-06-27 22:07:00 【But I'm still hungry】
1. about float Numerical comparison of types , To avoid loss of accuracy
BigDecimal class
Self encapsulated tool class
package OPCutils;
import java.math.BigDecimal;
public class We {
public int floatCompare(float a, float b) {
BigDecimal bd1 = BigDecimal.valueOf(a);
BigDecimal bd2 = BigDecimal.valueOf(b);
return bd1.compareTo(bd2);
}
}
Concrete realization
public void zongceshi(){
OpcSOS opcSOS=new OpcSOS();
List<String> list = opcSOS.luxun();
We we = new We();
List<PlcdataDO> plclist=new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
PlcdataDO plcdataDOS = plcdataDao.selectSub(list.get(i));
plclist.add(plcdataDOS);
}
List<PlcdataDO> plclist1=new ArrayList<>();
for (PlcdataDO plcdataDO:plclist){
int i = we.floatCompa边栏推荐
- Codeforces Round #717 (Div. 2)
- MONTHS_ Between function use
- [Sword Offer II]剑指 Offer II 029. 排序的循环链表
- [LeetCode]513. 找树左下角的值
- Go 访问GBase 8a 数据库的一个方法
- [LeetCode]513. Find the value in the lower left corner of the tree
- [LeetCode]508. 出现次数最多的子树元素和
- 真香,自从用了Charles,Fiddler已经被我彻底卸载了
- Summary of Web testing and app testing by bat testing experts
- 读写分离-Mysql的主从复制
猜你喜欢

GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析

管理系统-ITclub(下)

Remote invocation of microservices

vmware虚拟机PE启动

Knowledge sorting of exception handling
![\w和[A-Za-z0-9_],\d和[0-9]等价吗?](/img/96/2649c9cf95b06887b57fd8af2d41c2.png)
\w和[A-Za-z0-9_],\d和[0-9]等价吗?

Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip

Codeforces Round #719 (Div. 3)

.NET学习笔记(五)----Lambda、Linq、匿名类(var)、扩展方法
![\W and [a-za-z0-9_], \Are D and [0-9] equivalent?](/img/96/2649c9cf95b06887b57fd8af2d41c2.png)
\W and [a-za-z0-9_], \Are D and [0-9] equivalent?
随机推荐
Codeforces Round #721 (Div. 2)
vmware虚拟机PE启动
Common problems encountered by burp Suite
[LeetCode]动态规划解分割数组I[Red Fox]
Codeforces Round #717 (Div. 2)
Gbase 8A OLAP analysis function cume_ Example of dist
Summary of gbase 8A database user password security related parameters
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
GBase 8a OLAP分析函数cume_dist的使用样例
IO stream code
. Net learning notes (V) -- lambda, LINQ, anonymous class (VaR), extension method
VMware virtual machine PE startup
Figure countdownlatch and cyclicbarrier based on AQS queue
【Redis】零基础十分钟学会Redis
Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip
Acwing weekly contest 57- digital operation - (thinking + decomposition of prime factor)
Gbase 8A OLAP analysis function cume_ Example of dist
[LeetCode]30. 串联所有单词的子串
Interval DP of Changyou dynamic programming
分享|智慧环保-生态文明信息化解决方案(附PDF)