Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
What does this code do?

C#
public class Epsilon
    {
        public static double Value
        {
            get { return 1.0e-5; }
        }
    }
Posted
Comments
Member 8686696 12-Oct-12 10:55am    
i understand that it'll return the 1.0e-5, is it a common value when dealing with Matrices?
Herman<T>.Instance 12-Oct-12 11:00am    
then why ask this question?

you have a readonly property in stead of a const or something like that.

To add a little to Marcus's solution, it's scientific notation, 'e' is basically 'times 10 to the power of' so in this case, it's 1.0 times 10^(-5).

(This next part is just an educated guess)

Epsilon is sometimes used in mathematics to represent a minimal change from one number to another (e.g. 1 + epsilon is just a tiny bit above 1), but since computers are discrete I'm guessing 1.0e-5 has just been arbitrarily chosen as a small value that will behave similar to epsilon in mathematics, but for discrete values.

It's really hard to tell you more without some context. We don't know what the rest of the code looks like.
 
Share this answer
 
That's the OOP way to say:
C#
const double EPSILON = 0.00005;

:-)
 
Share this answer
 
Comments
SameerNA 12-Oct-12 15:31pm    
+5 from me
Monjurul Habib 15-Oct-12 16:42pm    
5!
It just returns 0.00001 (It is just a different notation for that value)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900