What is a scientific notation and why is double printed in scientific notation in Java?
问题 I use this code: long elapsedTime = now - lastTime; delta = ((double) elapsedTime) / 1000000000; System.out.println(elapsedTime); System.out.println(delta); This is my output: 173290 1.7329E-4 This output gives me scientific notation, but I don't know what it is. Can you explain me? And why is double printed in scientific notation? 回答1: The output you're seeing is scientific notation. In Java, double is printed as scientific notation if the magnitude is less than 10^-3 or greater than 10^7 .