Commits

Philip Jenvey committed ca21deb

less strict comparison of the number doctests results to fix these tests on
Jython

Comments (0)

Files changed (1)

webhelpers/number.py

     The following examples are taken from Wikipedia.
     http://en.wikipedia.org/wiki/Standard_deviation
 
-        >>> standard_deviation([0, 0, 14, 14])
-        8.0829037686547611
-        >>> standard_deviation([0, 6, 8, 14])
-        5.7735026918962582
+        >>> standard_deviation([0, 0, 14, 14]) # doctest: +ELLIPSIS
+        8.082903768654761...
+        >>> standard_deviation([0, 6, 8, 14]) # doctest: +ELLIPSIS
+        5.773502691896258...
         >>> standard_deviation([6, 6, 8, 8])
         1.1547005383792515
 
     
         # Fictitious average monthly temperatures in Southern California.
         #                       Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
-        >>> standard_deviation([70, 70, 70, 75, 80, 85, 90, 95, 90, 80, 75, 70]) 
-        9.0033663737851999
+        >>> standard_deviation([70, 70, 70, 75, 80, 85, 90, 95, 90, 80, 75, 70]) # doctest: +ELLIPSIS
+        9.003366373785...
 
         # Fictitious average mothly temperatures in Montana.
         #                       Jan  Feb  Mar Apr May Jun Jul  Aug Sep Oct Nov Dec
-        >>> standard_deviation([-32, -10, 20, 30, 60, 90, 100, 80, 60, 30, 10, -32])
-        45.137836040557403
+        >>> standard_deviation([-32, -10, 20, 30, 60, 90, 100, 80, 60, 30, 10, -32]) # doctest: +ELLIPSIS
+        45.1378360405574...
 
     Most natural and random phenomena follow the normal distribution (aka the
     bell curve), which says that most values are close to average but a few are
     >>> stats.count
     3
     >>> stats.finish()
-    >>> stats.mean
-    8.3333333333333339
+    >>> stats.mean # doctest: +ELLIPSIS
+    8.33333333333333...
     >>> stats.median
     10
     >>> stats.standard_deviation
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.