当前位置:网站首页>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边栏推荐
- IO stream code
- 畅游动态规划之区间DP
- [LeetCode]515. Find the maximum value in each tree row
- Codeforces Round #719 (Div. 3)
- qt base64加解密
- [LeetCode]513. 找树左下角的值
- C语言程序设计详细版 (学习笔记1) 看完不懂,我也没办法。
- Gbase 8A OLAP analysis function cume_ Example of dist
- [MySQL] database function clearance Tutorial Part 2 (window function topic)
- [LeetCode]30. Concatenate substrings of all words
猜你喜欢

"Apprendre cette image" apparaît sur le Bureau win11 comment supprimer

Common problems encountered by burp Suite

Use Fiddler to simulate weak network test (2g/3g)

Experience sharing of meituan 20K Software Test Engineers
![[leetcode] dynamic programming solution partition array i[red fox]](/img/b2/df87c3138c28e83a8a58f80b2938b8.png)
[leetcode] dynamic programming solution partition array i[red fox]

Codeforces Round #717 (Div. 2)
![[MySQL] database function clearance Tutorial Part 2 (window function topic)](/img/03/2b37e63d0d482d5020b7421ac974cb.jpg)
[MySQL] database function clearance Tutorial Part 2 (window function topic)

vmware虚拟机PE启动

Gao fushuai in the unit testing industry, pytest framework, hands-on teaching, will do this in the future test reports~

开源技术交流丨一站式全自动化运维管家ChengYing入门介绍
随机推荐
管理系統-ITclub(下)
How to delete "know this picture" on win11 desktop
\w和[A-Za-z0-9_],\d和[0-9]等价吗?
QT large file generation MD5 check code
xpath
管理系统-ITclub(上)
List of language weaknesses --cwe, a website worth learning
AQS SOS AQS with me
C语言程序设计详细版 (学习笔记1) 看完不懂,我也没办法。
Software defect management - a must for testers
Analysis of stone merging
Express e stack - small items in array
Educational Codeforces Round 108 (Rated for Div. 2)
Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip
GBase 8a OLAP分析函数cume_dist的使用样例
Set code exercise
Go from introduction to actual combat - task cancellation (note)
[leetcode] 508. Élément de sous - arbre le plus fréquent et
win11桌面出現“了解此圖片”如何删除
Special training of guessing game