Java Number Max Value max255(float val)

Here you can find the source of max255(float val)

Description

max

License

Open Source License

Declaration

private static int max255(float val) 

Method Source Code

//package com.java2s;
/*//from w  w  w  .  j a va 2  s.co m
 *  Copyright (C) 2010-2016 JPEXS, All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */

public class Main {
    private static int max255(float val) {
        if (val > 255) {
            return 255;
        }
        return (int) val;
    }
}

Related

  1. max(T c1, T c2)
  2. max(T v1, T v2)
  3. max(T v1, T v2, int nullSupport)
  4. max2(double a, double b)
  5. max2(int a, int b)
  6. max3(double a, double b, double c)
  7. max3(int a, int b, int c)
  8. max3(int first, int second, int third)
  9. MAX3(int x, int y, int z)