当前位置:网站首页>记一次List对象遍历及float类型判断大小
记一次List对象遍历及float类型判断大小
2022-06-27 19:37:00 【可是我还饿啊】
1.对于float类型的数值比较,为了避免精度损失用到了
BigDecimal类
自己封装的工具类
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);
}
}
具体实现
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边栏推荐
- 豆沙绿保护你的双眼
- oracle迁移mysql唯一索引大小写不区分别怕
- Go从入门到实战——Panic和recover(笔记)
- Management system itclub (Part 2)
- Quick excel export
- [LeetCode]100. Same tree
- \w和[A-Za-z0-9_],\d和[0-9]等价吗?
- Bit. Store: long bear market, stable stacking products may become the main theme
- STM32CubeIDE1.9.0\STM32CubeMX 6.5 F429IGT6加LAN8720A,配置ETH+LWIP
- Little known MySQL import data
猜你喜欢

Read write separation master-slave replication of MySQL

Go from introduction to actual combat - execute only once (note)

Null pointer exception

Go从入门到实战——仅执行一次(笔记)

Go from starting to Real - Interface (note)
![\w和[A-Za-z0-9_],\d和[0-9]等价吗?](/img/96/2649c9cf95b06887b57fd8af2d41c2.png)
\w和[A-Za-z0-9_],\d和[0-9]等价吗?

Bit.Store:熊市漫漫,稳定Staking产品或成主旋律

win11桌面出现“了解此图片”如何删除

清华大学教授:软件测试已经走入一个误区——“非代码不可”

开源技术交流丨一站式全自动化运维管家ChengYing入门介绍
随机推荐
Gbase 8A OLAP analysis function cume_ Example of dist
真香,自从用了Charles,Fiddler已经被我彻底卸载了
BAT测试专家对web测试和APP测试的总结
哈希表-数组之和
Gbase 8A method for reducing the impact on the system by controlling resource usage through concurrency during node replacement of V8 version
Knowledge sorting of exception handling
Go from introduction to actual combat - all tasks completed (notes)
管理系統-ITclub(下)
Go從入門到實戰——接口(筆記)
Little known MySQL import data
[LeetCode]161. 相隔为 1 的编辑距离
Software test automation test -- interface test from entry to proficiency, learn a little every day
根据自定义excel标题模板快速excel导出
GBase 8a OLAP分析函数cume_dist的使用样例
How to design an elegant caching function
Go从入门到实战——行为的定义和实现(笔记)
Dynamic refresh mapper
Express e stack - small items in array
Method of reading file contents by Excel
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear