[ 
https://issues.apache.org/jira/browse/FLINK-33725?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-33725:
-----------------------------------
    Labels: pull-request-available  (was: )

> MathUtils.isPowerOf2  does not cover the case of value=0
> --------------------------------------------------------
>
>                 Key: FLINK-33725
>                 URL: https://issues.apache.org/jira/browse/FLINK-33725
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / Core
>            Reporter: Jes Cok
>            Priority: Minor
>              Labels: pull-request-available
>
> org.apache.flink.util.MathUtils.isPowerOf2, 
>  
> This static method does not cover the case of value=0.
> Should the document explain that value cannot be =0?
> Or could it be re implemented as the following code?
>  
> public static boolean isPowerOf2(long value) {
>   return value > 0 && (value & (value - 1)) == 0;
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to