You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Greg Hogan (JIRA)" <ji...@apache.org> on 2016/09/23 18:51:20 UTC
[jira] [Closed] (FLINK-4668) Fix positive random int generation
[ https://issues.apache.org/jira/browse/FLINK-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Hogan closed FLINK-4668.
-----------------------------
Resolution: Implemented
Implemented in 40c978b0443d9cb3ee66b6e0e63ab61416deac25
> Fix positive random int generation
> ----------------------------------
>
> Key: FLINK-4668
> URL: https://issues.apache.org/jira/browse/FLINK-4668
> Project: Flink
> Issue Type: Improvement
> Components: Client
> Reporter: Alexander Pivovarov
> Priority: Trivial
> Fix For: 1.2.0
>
>
> According to java spec
> {code}Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE{code}
> So, {code}Math.abs(rnd.nextInt()){code} might return negative value
> To generate positive random int value we can use
> {code}rnd.nextInt(Integer.MAX_VALUE){code}
> Integer.MAX_VALUE will be excluded btw
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)