What does division by 1e9d mean?

user1071840 picture user1071840 · Dec 12, 2013 · Viewed 9.3k times · Source

This is the snippet:

String myTime = someTime / 1e9d + ",";

someTime is derived by using System.nanoTime(). What does 1e9d do here?

Answer

GGrec picture GGrec · Dec 12, 2013

1e9 means 10^9
2d means 2 as double

e.g.

  • sysout 1e9 => 1.0E9
  • sysout 10e9 => 1.0E10

See also the Floating-Point Literals section of The Java™ Tutorials.