Skip to content

Instantly share code, notes, and snippets.

@travisbrady
Created October 9, 2017 14:22
Show Gist options
  • Save travisbrady/1a59745c06781cbaedb3a444edc4a0a7 to your computer and use it in GitHub Desktop.
Save travisbrady/1a59745c06781cbaedb3a444edc4a0a7 to your computer and use it in GitHub Desktop.
NaN NaN NaN
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
ArrayList x = new ArrayList<Double>(Arrays.asList(1.0, Double.NaN, 2.0, 1.0, 99.0, 3.0, 4.0, 5.0));
Collections.sort(x);
Collections.reverse(x);
for(int i=0; i<x.size(); i++) {
System.out.println(x.get(i));
}
System.out.println(0.0/0.0);
System.out.println();
double yo = 0.0/0.0;
System.out.println(yo * 0.23);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment