Java Number Max Value max(float dirOffset, float min, float max)

Here you can find the source of max(float dirOffset, float min, float max)

Description

Gets the maximum of two values based on direction

License

LGPL

Parameter

Parameter Description
dirOffset the offset of the direction
min the minimum
max the maximum

Return

the maximum of two values based on direction

Declaration

public static float max(float dirOffset, float min, float max) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /**// w ww. jav a  2 s  .c om
     * Gets the maximum of two values based on direction
     * @param dirOffset the offset of the direction
     * @param min the minimum
     * @param max the maximum
     * @return the maximum of two values based on direction
     */
    public static float max(float dirOffset, float min, float max) {
        return dirOffset == 1 ? 1 : dirOffset == -1 ? min : max;
    }
}

Related

  1. max(float a, float b)
  2. max(float a, float b)
  3. max(float a, float b)
  4. max(float a, float b, float c)
  5. max(float a, float b, float c, float d, float e)
  6. max(float value1, float value2)
  7. max(float value1, float value2)
  8. max(float x0, float x1)
  9. max(int a, int b)