diff --git modules/simpletest/drupal_web_test_case.php modules/simpletest/drupal_web_test_case.php
index 714cc2e..1545107 100644
--- modules/simpletest/drupal_web_test_case.php
+++ modules/simpletest/drupal_web_test_case.php
@@ -362,6 +362,70 @@ abstract class DrupalTestCase {
   }
 
   /**
+   * Check to see if the positive difference is less than $margin.
+   *
+   * More specifically:
+   * @code
+   *   abs($first - $second) < $margin
+   * @endcode
+   *
+   * This function is especially useful when you want to test a floating point
+   * value, since exact floating point comparison seldom works.
+   *
+   * @param $first
+   *   The first value.
+   * @param $second
+   *   The second value.
+   * @param $margin
+   *   The maximum allowed absolute difference between $first and $second.
+   * @param $message
+   *   The message to display along with the assertion.
+   * @param $group
+   *   The type of assertion - examples are "Browser", "PHP".
+   * @return
+   *   The status passed in.
+   */
+  protected function assertWithinMargin($first, $second, $margin, $message = '', $group = 'Other') {
+    return $this->assert(
+      abs($first - $second) < $margin,
+      $message ? $message : t('The positive difference between @first and @second value is less than the @margin', array('@first' => $first, '@second' => $second, '@margin' => $margin)),
+      $group
+    );
+  }
+
+  /**
+   * Check to see if the positive difference is more than $margin.
+   *
+   * More specifically:
+   * @code
+   *   abs($first - $second) > $margin
+   * @endcode
+   *
+   * This function is especially useful when you want to test a floating point
+   * value, since exact floating point comparison seldom works.
+   *
+   * @param $first
+   *   The first value.
+   * @param $second
+   *   The second value.
+   * @param $margin
+   *   The minimum allowed absolute difference between $first and $second.
+   * @param $message
+   *   The message to display along with the assertion.
+   * @param $group
+   *   The type of assertion - examples are "Browser", "PHP".
+   * @return
+   *   The status passed in.
+   */
+  protected function assertOutsideMargin($first, $second, $margin, $message = '', $group = 'Other') {
+    return $this->assert(
+      abs($first - $second) > $margin,
+      $message ? $message : t('The positive difference between @first and @second value is greater than the @margin', array('@first' => $first, '@second' => $second, '@margin' => $margin)),
+      $group
+    );
+  }
+
+  /**
    * Fire an assertion that is always positive.
    *
    * @param $message
diff --git modules/simpletest/simpletest.test modules/simpletest/simpletest.test
index 86cbd60..e4b724d 100644
--- modules/simpletest/simpletest.test
+++ modules/simpletest/simpletest.test
@@ -120,6 +120,12 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
     $this->pass($this->pass);
     $this->fail($this->fail);
 
+    $this->assertWithinMargin(5, 10, 6);
+    $this->assertWithinMargin(5, 10, 4);
+
+    $this->assertOutsideMargin(5, 10, 6);
+    $this->assertOutsideMargin(5, 10, 4);
+
     $this->drupalCreateUser(array($this->valid_permission));
     $this->drupalCreateUser(array($this->invalid_permission));
 
@@ -151,6 +157,24 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
     $this->assertAssertion($this->pass, 'Other', 'Pass', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
     $this->assertAssertion($this->fail, 'Other', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
 
+    $this->assertAssertion(
+      t('The positive difference between @first and @second value is less than the @margin', array('@first' => 5, '@second' => 10, '@margin' => 6)),
+      'Other', 'Pass', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()'
+    );
+    $this->assertAssertion(
+      t('The positive difference between @first and @second value is less than the @margin', array('@first' => 5, '@second' => 10, '@margin' => 4)),
+      'Other', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()'
+    );
+
+    $this->assertAssertion(
+      t('The positive difference between @first and @second value is greater than the @margin', array('@first' => 5, '@second' => 10, '@margin' => 6)),
+      'Other', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()'
+    );
+    $this->assertAssertion(
+      t('The positive difference between @first and @second value is greater than the @margin', array('@first' => 5, '@second' => 10, '@margin' => 4)),
+      'Other', 'Pass', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()'
+    );
+
     $this->assertAssertion(t('Created permissions: @perms', array('@perms' => $this->valid_permission)), 'Role', 'Pass', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
     $this->assertAssertion(t('Invalid permission %permission.', array('%permission' => $this->invalid_permission)), 'Role', 'Fail', 'simpletest.test', 'SimpleTestFunctionalTest->stubTest()');
 
