views:

411

answers:

5

This is an excerpt of code from a class I am working with in Java (below). Obviously the code is defining a static variable named EPSILON with the data type double. What I don't understand is the "1E-14" part. What kind of number is that? What does it mean?

final double EPSILON = 1E-14;

+4  A: 

1E3 => 1000

1E-1 => 0.1

1E-2 => 0.01

It's a way for writing 1 * 10-14

Owen
+8  A: 

The "E" notation is scientific notation. You'll see it on calculators too. It means "one times (ten to the power of -14)".

For another example, 2E+6 == 2,000,000.

Matt Hamilton
+2  A: 

1E-14 is 1 times 10 to the power of -14

Vincent McNabb
I think you mean 10, 1 to the -14 = 1
Owen
+15  A: 

In your case, this is equivalent to writing:

final double EPSILON = 0.00000000000001;

except you don't have to count the zeros. This is called scientific notation and is helpful when writing very large or very small numbers.

Greg Hewgill
+3  A: 

That's Exponential notation

Dan