Click here to Skip to main content
Rate this: bad
good
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 at 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 at 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 at 12-Oct-12 15:31pm
   
+5 from me
Monjurul Habib at 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
0 OriginalGriff 448
1 Sergey Alexandrovich Kryukov 290
2 PhilLenoir 95
3 Uma Shankar Patel 80
4 CB Sharma 79
0 Sergey Alexandrovich Kryukov 6,532
1 OriginalGriff 5,976
2 CPallini 2,473
3 Richard MacCutchan 1,687
4 Abhinav S 1,550


Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2014
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