Example usage for java.lang Integer MIN_VALUE

List of usage examples for java.lang Integer MIN_VALUE

Introduction

In this page you can find the example usage for java.lang Integer MIN_VALUE.

Prototype

int MIN_VALUE

To view the source code for java.lang Integer MIN_VALUE.

Click Source Link

Document

A constant holding the minimum value an int can have, -231.

Usage

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.MIN_VALUE);
}

From source file:Main.java

public static void main(String args[]) {

    int mininteger = Integer.MIN_VALUE;
    System.out.println(mininteger);
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.MIN_VALUE);
    System.out.println(Integer.MAX_VALUE);
}

From source file:MainClass.java

public static void main(String[] arg) {
    System.out.println(Integer.MAX_VALUE);

    System.out.println(Integer.MIN_VALUE);

}

From source file:Main.java

public static void main(String[] args) {
    int[] a = new int[10];

    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;

    for (int b = 0; b < a.length; b++) {
        a[b] = new Random().nextInt(100);
    }/*from ww w .  j a  va2s .c o  m*/

    for (int b = 0; b < a.length; b++) {
        if (a[b] < min)
            min = a[b];
        if (a[b] > max)
            max = a[b];
    }
    System.out.println("Min is: " + min + " " + "Max is: " + max);
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println("Byte.MIN = " + Byte.MIN_VALUE);
    System.out.println("Byte.MAX = " + Byte.MAX_VALUE);
    System.out.println("Short.MIN = " + Short.MIN_VALUE);
    System.out.println("Short.MAX = " + Short.MAX_VALUE);
    System.out.println("Integer.MIN = " + Integer.MIN_VALUE);
    System.out.println("Integer.MAX = " + Integer.MAX_VALUE);
    System.out.println("Long.MIN = " + Long.MIN_VALUE);
    System.out.println("Long.MAX = " + Long.MAX_VALUE);
    System.out.println("Float.MIN = " + Float.MIN_VALUE);
    System.out.println("Float.MAX = " + Float.MAX_VALUE);
    System.out.println("Double.MIN = " + Double.MIN_VALUE);
    System.out.println("Double.MAX = " + Double.MAX_VALUE);
}

From source file:Main.java

public static void main(String args[]) {

    System.out.println("Min byte value   = " + Byte.MIN_VALUE);
    System.out.println("Max byte value   = " + Byte.MAX_VALUE);
    System.out.println("Min short value  = " + Short.MIN_VALUE);
    System.out.println("Max short value  = " + Short.MAX_VALUE);
    System.out.println("Min int value    = " + Integer.MIN_VALUE);
    System.out.println("Max int value    = " + Integer.MAX_VALUE);
    System.out.println("Min float value  = " + Float.MIN_VALUE);
    System.out.println("Max float value  = " + Float.MAX_VALUE);
    System.out.println("Min double value = " + Double.MIN_VALUE);
    System.out.println("Max double value = " + Double.MAX_VALUE);
}

From source file:Main.java

public static void main(String args[]) {
    NumberFormat formatter = new DecimalFormat();

    int maxinteger = Integer.MAX_VALUE;
    System.out.println(maxinteger);
    formatter = new DecimalFormat("0.######E0");
    System.out.println(formatter.format(maxinteger));

    formatter = new DecimalFormat("0.#####E0");
    System.out.println(formatter.format(maxinteger));

    int mininteger = Integer.MIN_VALUE;
    System.out.println(mininteger);

    formatter = new DecimalFormat("0.######E0");
    System.out.println(formatter.format(mininteger));

    formatter = new DecimalFormat("0.#####E0");
    System.out.println(formatter.format(mininteger));

    double d = 0.12345;
    formatter = new DecimalFormat("0.#####E0");
    System.out.println(formatter.format(d));

    formatter = new DecimalFormat("000000E0");
    System.out.println(formatter.format(d));
}

From source file:com.linkedin.pinot.perf.MultiValueReaderWriterBenchmark.java

public static void main(String[] args) throws Exception {
    List<String> lines = IOUtils.readLines(new FileReader(new File(args[0])));
    int totalDocs = lines.size();
    int max = Integer.MIN_VALUE;
    int maxNumberOfMultiValues = Integer.MIN_VALUE;
    int totalNumValues = 0;
    int data[][] = new int[totalDocs][];
    for (int i = 0; i < lines.size(); i++) {
        String line = lines.get(i);
        String[] split = line.split(",");
        totalNumValues = totalNumValues + split.length;
        if (split.length > maxNumberOfMultiValues) {
            maxNumberOfMultiValues = split.length;
        }//from w w w .  ja v  a  2 s .c o m
        data[i] = new int[split.length];
        for (int j = 0; j < split.length; j++) {
            String token = split[j];
            int val = Integer.parseInt(token);
            data[i][j] = val;
            if (val > max) {
                max = val;
            }
        }
    }
    int maxBitsNeeded = (int) Math.ceil(Math.log(max) / Math.log(2));
    int size = 2048;
    int[] offsets = new int[size];
    int bitMapSize = 0;
    File outputFile = new File("output.mv.fwd");

    FixedBitSkipListSCMVWriter fixedBitSkipListSCMVWriter = new FixedBitSkipListSCMVWriter(outputFile,
            totalDocs, totalNumValues, maxBitsNeeded);

    for (int i = 0; i < totalDocs; i++) {
        fixedBitSkipListSCMVWriter.setIntArray(i, data[i]);
        if (i % size == size - 1) {
            MutableRoaringBitmap rr1 = MutableRoaringBitmap.bitmapOf(offsets);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(bos);
            rr1.serialize(dos);
            dos.close();
            //System.out.println("Chunk " + i / size + " bitmap size:" + bos.size());
            bitMapSize += bos.size();
        } else if (i == totalDocs - 1) {
            MutableRoaringBitmap rr1 = MutableRoaringBitmap.bitmapOf(Arrays.copyOf(offsets, i % size));
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(bos);
            rr1.serialize(dos);
            dos.close();
            //System.out.println("Chunk " + i / size + " bitmap size:" + bos.size());
            bitMapSize += bos.size();
        }
    }
    fixedBitSkipListSCMVWriter.close();
    System.out.println("Output file size:" + outputFile.length());
    System.out.println("totalNumberOfDoc\t\t\t:" + totalDocs);
    System.out.println("totalNumberOfValues\t\t\t:" + totalNumValues);
    System.out.println("chunk size\t\t\t\t:" + size);
    System.out.println("Num chunks\t\t\t\t:" + totalDocs / size);
    int numChunks = totalDocs / size + 1;
    int totalBits = (totalNumValues * maxBitsNeeded);
    int dataSizeinBytes = (totalBits + 7) / 8;

    System.out.println("Raw data size with fixed bit encoding\t:" + dataSizeinBytes);
    System.out.println("\nPer encoding size");
    System.out.println();
    System.out.println("size (offset + length)\t\t\t:" + ((totalDocs * (4 + 4)) + dataSizeinBytes));
    System.out.println();
    System.out.println("size (offset only)\t\t\t:" + ((totalDocs * (4)) + dataSizeinBytes));
    System.out.println();
    System.out.println("bitMapSize\t\t\t\t:" + bitMapSize);
    System.out.println("size (with bitmap)\t\t\t:" + (bitMapSize + (numChunks * 4) + dataSizeinBytes));

    System.out.println();
    System.out.println("Custom Bitset\t\t\t\t:" + (totalNumValues + 7) / 8);
    System.out.println("size (with custom bitset)\t\t\t:"
            + (((totalNumValues + 7) / 8) + (numChunks * 4) + dataSizeinBytes));

}

From source file:MinVariablesDemo.java

public static void main(String args[]) {

    // integers//from   w w w . j a va2 s . c o m
    byte smallestByte = Byte.MIN_VALUE;
    short smallestShort = Short.MIN_VALUE;
    int smallestInteger = Integer.MIN_VALUE;
    long smallestLong = Long.MIN_VALUE;

    // real numbers
    float smallestFloat = Float.MIN_VALUE;
    double smallestDouble = Double.MIN_VALUE;

    // display them all
    System.out.println("The smallest byte value is " + smallestByte);
    System.out.println("The smallest short value is " + smallestShort);
    System.out.println("The smallest integer value is " + smallestInteger);
    System.out.println("The smallest long value is " + smallestLong);

    System.out.println("The smallest float value is " + smallestFloat);
    System.out.println("The smallest double value is " + smallestDouble);
}