mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add method
This commit is contained in:
parent
52d4d60a62
commit
9308d66837
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.7.17 (2021-11-30)
|
||||
# 5.7.17 (2021-12-01)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 增加AsyncUtil(pr#457@Gitee)
|
||||
@ -30,6 +30,7 @@
|
||||
* 【poi 】 SheetRidReader可以获取所有sheet名(issue#I4JA3M@Gitee)
|
||||
* 【core 】 AsyncUtil.waitAny增加返回值(pr#473@Gitee)
|
||||
* 【core 】 Calculator.compare改为private(issue#1982@Github)
|
||||
* 【core 】 NumberUtil增加isOdd、isEven方法(pr#474@Gitee)
|
||||
*
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复FileResource构造fileName参数无效问题(issue#1942@Github)
|
||||
|
@ -2713,12 +2713,10 @@ public class NumberUtil {
|
||||
* @param num 被判断的数值
|
||||
* @return 是否是奇数
|
||||
* @author GuoZG
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public static boolean isOdd(int num) {
|
||||
if ((num & 1) == 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return (num & 1) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2727,12 +2725,10 @@ public class NumberUtil {
|
||||
* @param num 被判断的数值
|
||||
* @return 是否是偶数
|
||||
* @author GuoZG
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public static boolean isEven(int num) {
|
||||
if (!isOdd(num)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return false == isOdd(num);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------- Private method start
|
||||
|
Loading…
x
Reference in New Issue
Block a user