Advertisement
Guest User

Crazy Short Circuiting Decompiled

a guest
Apr 7th, 2013
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.64 KB | None | 0 0
  1. public class Test
  2. {
  3.     Test() {
  4.         super();
  5.     }
  6.    
  7.     public static void main(String[] args) {
  8.         System.out.println("Please enter values:");
  9.         final Scanner in = new Scanner(System.in);
  10.         double largest = Double.NEGATIVE_INFINITY;
  11.         double smallest = Double.POSITIVE_INFINITY;
  12.         while (true) {
  13.             final double nextDouble = in.nextDouble();
  14.             final double input = nextDouble;
  15.             if (nextDouble != 0.0) {
  16.                 if (input > largest) {
  17.                     final double num = input;
  18.                     largest = num;
  19.                     if (num != input) {
  20.                         continue;
  21.                     }
  22.                 }
  23.                 if (input < smallest) {
  24.                     final double num2 = input;
  25.                     smallest = num2;
  26.                     if (num2 != input) {
  27.                     }
  28.                 }
  29.             }
  30.             else {
  31.                 if (largest != Double.NEGATIVE_INFINITY) {
  32.                     break;
  33.                 }
  34.                 final double num3 = 0.0;
  35.                 largest = num3;
  36.                 if (num3 != 0.0) {
  37.                     break;
  38.                 }
  39.                 final double num4 = 0.0;
  40.                 smallest = num4;
  41.                 if (num4 == 0.0) {
  42.                     break;
  43.                 }
  44.             }
  45.         }
  46.         in.close();
  47.         System.out.println(new StringBuilder().append("The smallest value was ").append(smallest).toString());
  48.         System.out.println(new StringBuilder().append("The largest value was ").append(largest).toString());
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement