fork download
  1. public class Main {
  2.  
  3. public static void main(String[] args) {
  4. final double INF = Double.POSITIVE_INFINITY;
  5. System.out.println(INF + 1);
  6. System.out.println(INF + INF);
  7. System.out.println(Math.max(INF, 1));
  8. System.out.println(Math.max(INF, INF));
  9. }
  10.  
  11. }
Success #stdin #stdout 0.09s 212416KB
stdin
Standard input is empty
stdout
Infinity
Infinity
Infinity
Infinity