Click here to Skip to main content
12,350,443 members (23,393 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
What does this code do?

public class Epsilon
    {
        public static double Value
        {
            get { return 1.0e-5; }
        }
    }
Posted 12-Oct-12 4:54am
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?
digimanus 12-Oct-12 11:00am
   
then why ask this question?

you have a readonly property in stead of a const or something like that.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

That's the OOP way to say:
const double EPSILON = 0.00005;
Smile | :)
  Permalink  
Comments
SameerNA 12-Oct-12 15:31pm
   
+5 from me
Monjurul Habib 15-Oct-12 16:42pm
   
5!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

It just returns 0.00001 (It is just a different notation for that value)
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100