List of usage examples for java.lang Double MIN_VALUE
double MIN_VALUE
To view the source code for java.lang Double MIN_VALUE.
Click Source Link
From source file:Main.java
public static void main(String[] args) { System.out.println(Double.MIN_VALUE); System.out.println(Double.longBitsToDouble(0x1L)); }
From source file:Main.java
public static void main(String[] args) { System.out.println(Double.MIN_VALUE); System.out.println(Double.MAX_VALUE); }
From source file:MainClass.java
public static void main(String args[]) { System.out.println(Double.MIN_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) { 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:MinVariablesDemo.java
public static void main(String args[]) { // integers//w w w . j a va2s.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); }
From source file:org.jfree.chart.demo.SmallNumberDemo.java
/** * Starting point for the demonstration application. * * @param args ignored.// ww w . j ava2s.c o m */ public static void main(final String[] args) { System.out.println("Min Double: " + Double.MIN_VALUE); final SmallNumberDemo demo = new SmallNumberDemo("Small Number Demo"); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); }
From source file:edu.msu.cme.rdp.abundstats.cli.AbundMain.java
public static void main(String[] args) throws IOException { File inputFile;/*from w w w .ja v a2 s .co m*/ File resultDir = new File("."); RPlotter plotter = null; boolean isClusterFile = true; List<AbundStatsCalculator> statCalcs = new ArrayList(); double clustCutoffFrom = Double.MIN_VALUE, clustCutoffTo = Double.MAX_VALUE; String usage = "Main [options] <cluster file>"; try { CommandLine line = new PosixParser().parse(options, args); if (line.hasOption("result-dir")) { resultDir = new File(line.getOptionValue("result-dir")); if (!resultDir.exists() && !resultDir.mkdirs()) { throw new Exception( "Result directory " + resultDir + " does not exist and could not be created"); } } if (line.hasOption("R-location")) { plotter = new RPlotter(); plotter.setCommandTemplate(rplotterTemplate); plotter.setRPath(line.getOptionValue("R-location")); plotter.setOutFileExt(".png"); if (!new File(plotter.getRPath()).canExecute()) { throw new Exception(plotter.getRPath() + " does not exist or is not exectuable"); } } if (line.hasOption("lower-cutoff")) { clustCutoffFrom = Double.valueOf(line.getOptionValue("lower-cutoff")); } if (line.hasOption("upper-cutoff")) { clustCutoffTo = Double.valueOf(line.getOptionValue("upper-cutoff")); } if (line.hasOption("jaccard")) { statCalcs.add(new Jaccard(true)); } if (line.hasOption("sorensen")) { statCalcs.add(new Sorensen(true)); } if (line.hasOption("otu-table")) { isClusterFile = false; } if (statCalcs.isEmpty()) { throw new Exception("Must specify at least one stat to compute (jaccard, sorensen)"); } args = line.getArgs(); if (args.length != 1) { throw new Exception("Unexpected number of command line arguments"); } inputFile = new File(args[0]); } catch (Exception e) { new HelpFormatter().printHelp(usage, options); System.err.println("Error: " + e.getMessage()); return; } if (isClusterFile) { RDPClustParser parser; parser = new RDPClustParser(inputFile); try { if (parser.getClusterSamples().size() == 1) { throw new IOException("Cluster file must have more than one sample"); } List<Cutoff> cutoffs = parser.getCutoffs(clustCutoffFrom, clustCutoffTo); if (cutoffs.isEmpty()) { throw new IOException( "No cutoffs in cluster file in range [" + clustCutoffFrom + "-" + clustCutoffTo + "]"); } for (Cutoff cutoff : cutoffs) { List<Sample> samples = new ArrayList(); for (ClusterSample clustSample : parser.getClusterSamples()) { Sample s = new Sample(clustSample.getName()); for (Cluster clust : cutoff.getClusters().get(clustSample.getName())) { s.addSpecies(clust.getNumberOfSeqs()); } samples.add(s); } processSamples(samples, statCalcs, resultDir, cutoff.getCutoff() + "_", plotter); } } finally { parser.close(); } } else { List<Sample> samples = new ArrayList(); BufferedReader reader = new BufferedReader(new FileReader(inputFile)); String line = reader.readLine(); if (line == null || line.split("\\s+").length < 2) { throw new IOException("Must be 2 or more samples for abundance statistic calculations!"); } int numSamples = line.split("\\s+").length; boolean header = true; try { Integer.valueOf(line.split("\\s+")[0]); header = false; } catch (Exception e) { } if (header) { for (String s : line.split("\\s+")) { samples.add(new Sample(s)); } } else { int sample = 0; for (String s : line.split("\\s+")) { samples.add(new Sample("" + sample)); samples.get(sample).addSpecies(Integer.valueOf(s)); sample++; } } int lineno = 2; while ((line = reader.readLine()) != null) { if (line.trim().equals("")) { continue; } int sample = 0; if (line.split("\\s+").length != numSamples) { System.err.println( "Line number " + lineno + " didn't have the expected number of samples (contained " + line.split("\\s+").length + ", expected " + numSamples + ")"); } for (String s : line.split("\\s+")) { samples.get(sample).addSpecies(Integer.valueOf(s)); sample++; } lineno++; } processSamples(samples, statCalcs, resultDir, inputFile.getName(), plotter); } }
From source file:pt.minha.calibration.Calibrator.java
public static void main(String[] args) throws Throwable { if (args.length != 1) { logger.error("missing command line argument (--server | <servername>)"); } else if (args[0].equals("--server")) { runServer();//from w ww.j a v a2s.c o m } else { Calibrator calib = new Calibrator(args[0]); Properties props = new Properties(); SimpleRegression cpuoh = new SimpleRegression(true); for (int i : new int[] { 100, 1000, 10000, 20000 }) { Map<String, Object> p = new HashMap<String, Object>(); p.put("bench", CPUBenchmark.class.getName()); p.put("samples", 50000); p.put("payload", i); Result r = calib.runReal(p); Result s = calib.runSimulated(p, props); cpuoh.addData(s.meanCPU, r.meanCPU); } props.setProperty("cpuScaling", new Linear(cpuoh.getIntercept(), cpuoh.getSlope()).toString()); // Run double max = Double.MIN_VALUE; SimpleRegression netCPU = new SimpleRegression(true); SimpleRegression netCPU_s = new SimpleRegression(true); for (int i : new int[] { 1, 100, 1000, 4000, 8000, 16000 }) { Map<String, Object> p = new HashMap<String, Object>(); p.put("bench", TCPOverheadBenchmark.class.getName()); p.put("server", new InetSocketAddress(args[0], 20000)); p.put("samples", 5000); p.put("payload", i); Result r = calib.runReal(p); netCPU.addData(i, r.meanCPU); Result s = calib.runSimulated(p, props); netCPU_s.addData(i, s.meanCPU); double bw = 8 * i * 1e9d / r.meanLatency; if (bw > max) max = bw; } props.setProperty("networkBandwidth", Long.toString((long) max)); props.setProperty("tcpOverhead", new Linear((netCPU.getIntercept() - netCPU_s.getIntercept()) / 2, (netCPU.getSlope() - netCPU_s.getSlope()) / 2).toString()); SimpleRegression udpCPU = new SimpleRegression(true); SimpleRegression udpCPU_s = new SimpleRegression(true); for (int i : new int[] { 1, 100, 1000, 4000, 8000, 16000 }) { Map<String, Object> p = new HashMap<String, Object>(); p.put("bench", UDPOverheadBenchmark.class.getName()); p.put("server", new InetSocketAddress(args[0], 20000)); p.put("samples", 5000); p.put("payload", i); Result r = calib.runReal(p); udpCPU.addData(i, r.meanCPU); Result s = calib.runSimulated(p, props); udpCPU_s.addData(i, s.meanCPU); } props.setProperty("udpOverhead", new Linear((udpCPU.getIntercept() - udpCPU_s.getIntercept()) / 2, (udpCPU.getSlope() - udpCPU_s.getSlope()) / 2).toString()); SimpleRegression rtt = new SimpleRegression(true); SimpleRegression rtt_s = new SimpleRegression(true); for (int i : new int[] { 1, 100, 1000, 4000, 8000, 16000 }) { Map<String, Object> p = new HashMap<String, Object>(); p.put("bench", TCPLatencyBenchmark.class.getName()); p.put("server", new InetSocketAddress(args[0], 20000)); p.put("samples", 5000); p.put("payload", i); Result r = calib.runReal(p); rtt.addData(i, r.meanLatency); Result s = calib.runSimulated(p, props); rtt_s.addData(i, s.meanLatency); } props.setProperty("networkLatency", new Linear((rtt.getIntercept() - rtt_s.getIntercept()) / 2, (rtt.getSlope() - rtt_s.getSlope()) / 2).toString()); calib.close(); for (String key : props.stringPropertyNames()) logger.info("result: {}={}", key, props.getProperty(key)); // Write results FileOutputStream file = new FileOutputStream("calibration.properties"); props.store(file, "Generated calibration properties"); file.close(); } }
From source file:Main.java
public static double max(double[] input) { double max = Double.MIN_VALUE; for (int i = 0; i < input.length; i++) { if (input[i] > max) { max = input[i];/*from www . j a va 2 s.c o m*/ } } return max; }