Commits

Anonymous committed b3129d8

Added epsilon usage for the math module documentation.

Comments (0)

Files changed (2)

doc/capi/math.rst

 ------
 .. data:: VEC_EPSILON
 
-  .. todo::
-    Detailled description about the eps usage.
+  A small fractional value to come around rounding issues on floating
+  point calculations. VEC_EPSILON is usually used to soothe rounding
+  differences and thus to allow the system to return an appropriate
+  state, with a small tradeoff for the exactness.
+
+  **Example:** ::
+
+     (0.0000000000001 - 0.0000000000009) == 0.0
+
+  Given that VEC_EPSILON is large enough, the above calculation will be
+  true. To get over rounding issues on vector operations with small
+  fractional parts or to make them more exact, the concrete epsilon
+  value can be adjusted on a per :class:`PyVector` basis.
 
 Functions
 ---------
 
   The vector coordinates. It holds up to *dim* values.
   
-.. cmember:: Py_ssize_t PyVector.dim;
+.. cmember:: Py_ssize_t PyVector.dim
 
   The number of dimensions (coordinate values), the PyVector can hold.
 
 .. cmember:: double PyVector.epsilon
 
-  .. todo::
-    Detailled description about the eps usage.
+  The fractional delta to use for soothing round differences for
+  floating point operations on the PyVector. see :cdata:`VEC_EPSILON`
+  for more details.
 
 Functions
 ^^^^^^^^^

doc/src/mathbase.xml

       <desc>Gets the length of the :class:`Vector`.</desc>
     </attr>
     <attr name="epsilon">
-      <desc>Gets or sets the exactness delta of the :class:`Vector`.</desc>
+      <desc>Gets or sets the exactness delta of the :class:`Vector`.
+      
+      epsilon represents a small fractional value to come around
+      rounding issues on floating point calculations. It is usually used
+      to soothe rounding differences and thus to allow the system to
+      return an appropriate state, with a small tradeoff for the
+      exactness.
+
+      **Example:** ::
+
+        (0.0000000000001 - 0.0000000000009) == 0.0
+
+      Given that epsilon is large enough, the above calculation will be
+      true. To get over rounding issues on vector operations with small
+      fractional parts or to make them more exact, the concrete epsilon
+      value can be freely adjusted.
+      </desc>
     </attr>
     <attr name="elements">
       <desc>Gets or sets the elements of the :class:`Vector`.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.