flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4668) Fix positive random int generation
Date Fri, 23 Sep 2016 16:58:20 GMT

    [ https://issues.apache.org/jira/browse/FLINK-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15516971#comment-15516971
] 

ASF GitHub Bot commented on FLINK-4668:
---------------------------------------

Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/2539
  
    Yes, looks good to me, too.
    (I retract my earlier statement, I was apparently a bit tired and mixed up original version
and edit).


> Fix positive random int generation
> ----------------------------------
>
>                 Key: FLINK-4668
>                 URL: https://issues.apache.org/jira/browse/FLINK-4668
>             Project: Flink
>          Issue Type: Bug
>          Components: Client
>            Reporter: Alexander Pivovarov
>            Priority: Trivial
>
> 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)

Mime
View raw message