Development

Changeset 10846 for tools/lime/trunk/lib

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
08/13/08 15:36:24 (3 months ago)
Author:
fabien
Message:

[lime] fixed is() method for floats (closes #4187 - patch from bschussek)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/trunk/lib/lime.php

    r10005 r10846  
    1818class lime_test 
    1919{ 
     20  const EPSILON = 0.0000000001; 
     21 
    2022  public $plan = null; 
    2123  public $test_nb = 0; 
     
    9496    { 
    9597      $value = $exp1 === $exp2; 
     98    } 
     99    else if (is_float($exp1) && is_float($exp2)) 
     100    { 
     101      $value = abs($exp1 - $exp2) < self::EPSILON; 
    96102    } 
    97103    else