fork download
  1. class Ideone
  2. {
  3. public static void main(String[] args)
  4. {
  5. int a = 2000000000;
  6. int b = 2000000000;
  7. System.out.println(Math.sqrt(a*a+b*b));
  8. System.out.println(Math.sqrt((double)a*a+(double)b*b));
  9. System.out.println(Math.hypot(a,b));
  10. }
  11. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
31495.283710422424
2.82842712474619E9
2.82842712474619E9