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

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

Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4305#discussion_r126946827
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/configuration/Configuration.java ---
    @@ -843,11 +843,14 @@ private float convertToFloat(Object o, float 
defaultValue) {
                }
                else if (o.getClass() == Double.class) {
                        double value = ((Double) o);
    -                   if (value <= Float.MAX_VALUE && value >= 
Float.MIN_VALUE) {
    -                           return (float) value;
    -                   } else {
    +                   if (value < -Float.MAX_VALUE
    --- End diff --
    
    The current checks around `0` can be combined. Can we simplify this to two 
ranges, `-max` to `-min` and `min` to `max` (all inclusive), reverting the 
order of the if-else?


> Fix misusage of Double.MIN_VALUE and Float.MIN_VALUE
> ----------------------------------------------------
>
>                 Key: FLINK-7161
>                 URL: https://issues.apache.org/jira/browse/FLINK-7161
>             Project: Flink
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Kurt Young
>            Assignee: Kurt Young
>
> In FloatSummaryAggregator and DoubleSummaryAggregator, we used 
> Float.MIN_VALUE and Double.MIN_VALUE to be the initial values when doing max 
> aggregation which is wrong.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to