Here you can find the source of toInt(final long a)
Parameter | Description |
---|---|
a | A long value. |
public static int toInt(final long a)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w.j av a 2 s .c o m*/ * @param a * A long value. * @return The closest int value in [Integer.MIN_VALUE,Integer.MAX_VALUE] range. */ public static int toInt(final long a) { if (a != (int) a) { return a < 0 ? Integer.MIN_VALUE : Integer.MAX_VALUE; } return (int) a; } }