Java Float to Int floatToInt(float f, int defaultValue)

Here you can find the source of floatToInt(float f, int defaultValue)

Description

float To Int

License

LGPL

Declaration

public static int floatToInt(float f, int defaultValue) 

Method Source Code

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

public class Main {
    public static int floatToInt(float f, int defaultValue) {
        if (f >= Integer.MIN_VALUE && f <= Integer.MAX_VALUE) {
            return (int) f;
        }// ww w  .  java2  s  . c  o m
        return defaultValue;
    }
}

Related

  1. floatToInt(float f)
  2. floatToInt(float[] ints)
  3. floatToInt(float[] values)
  4. floatToInt(String flot)
  5. floatToInteger(final float value)