java.lang.Float.max()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中java.lang.Float.max()方法的一些代码示例,展示了Float.max()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Float.max()方法的具体详情如下:
包路径:java.lang.Float
类名称:Float
方法名:max

Float.max介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Get the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available) or the screen size.
 * @return the ratio between the {@link #getCanvasSize() GUI canvas size} and the application main windows (if available).
 * @see #getCanvasSize()
 */
public Vector2f getCanvasToWindowRatio() {
  if (environment != null){
    if (environment.getApplication() != null){
      if( ratio == null ) {
        ratio = new Vector2f();
        Vector2f canvas = getCanvasSize();
        int width = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth(),
            environment.getApplication().getContext().getSettings().getWidth());
        int height = Integer.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(),
            environment.getApplication().getContext().getSettings().getHeight());
        ratio.x = Float.max(1f, canvas.x / width);
        ratio.y = Float.max(1f, canvas.y / height);
      }
      return ratio;
    } else {
      throw new IllegalStateException("VR GUI manager underlying environment is not attached to any application.");
    }
  } else {
    throw new IllegalStateException("VR GUI manager is not attached to any environment.");
  }
}

代码示例来源:origin: apache/opennlp-sandbox

private static float max(float[] array) {
 float returnValue = Float.MIN_VALUE;
 for (int col=0; col < array.length; col++) {
   returnValue = Float.max(returnValue, array[col]);
 }
 return returnValue;
}

代码示例来源:origin: apache/opennlp-sandbox

private static float[] max_columnwise(float[][] array) {
 float[] returnValue = new float[array[0].length];
 for (int col=0; col < array[0].length; col++) {
  returnValue[col] = Float.MIN_VALUE;
  for (int row=0; row < array.length; row++) {
   returnValue[col] = Float.max(returnValue[col],array[row][col]);
  }
 }
 return returnValue;
}

代码示例来源:origin: exomiser/Exomiser

private float getMaxValue(String[] transcriptPredictions) {
  float maxValue = 0;
  for (int i = 0; i < transcriptPredictions.length; i++) {
    String score = transcriptPredictions[i];
    if (!EMPTY_VALUE.equals(score)) {
      float value = Float.parseFloat(score);
      //The larger the score the more likely the SNP has damaging effect.
      maxValue = Float.max(maxValue, value);
    }
  }
  return maxValue;
}

代码示例来源:origin: exomiser/Exomiser

float value = Float.parseFloat(score);
maxValue = Float.max(maxValue, value);

代码示例来源:origin: org.mule.runtime/mule-core

@Override
protected int resolveParallelism() {
 if (getMaxConcurrency() == Integer.MAX_VALUE) {
  return max(CORES / getSubscriberCount(), 1);
 } else {
  // Resolve maximum factor of max concurrency that is less than number of cores in order to respect maxConcurrency more
  // closely.
  return min(CORES, maxFactor(Float.max((float) getMaxConcurrency() / getSubscriberCount(), 1)));
 }
}

相关文章