     { 
         if (interval == 0)
             return Math.max(minimum, Math.min(maximum, value));
-
-        var minValue:Number = minimum;
-        var maxValue:Number = maximum;
+        
+        var maxValue:Number = maximum - minimum;
         var scale:Number = 1;
-
+        
+        value -= minimum;
+        
         // If interval isn't an integer, there's a possibility that the floating point 
         // approximation of value or value/interval will be slightly larger or smaller 
         // than the real value.  This can lead to errors in calculations like 

        if (interval != Math.round(interval)) 
        { 
            const parts:Array = (new String(1 + interval)).split("."); 
            scale = Math.pow(10, parts[1].length); 
            minValue *= scale;
            maxValue *= scale;
            value = Math.round(value * scale);
            interval = Math.round(interval * scale);
        }   
        
        var lower:Number = Math.max(minValue, Math.floor(value / interval) * interval);
        var upper:Number = Math.min(maxValue, Math.floor((value + interval) / interval) * interval);
        var validValue:Number = ((value - lower) >= ((upper - lower) / 2)) ? upper : lower;

        return validValue / scale;
    }
        
    /**

    }
    
    /**
     *  Returns the sum of the minimum with an integer multiple of <code>interval</code> that's 
     *  closest to <code>value</code>, unless <code>value</code> is closer to the maximum limit,
     *  in which case the maximum is returned.
     * 
     *  <p>If <code>interval</code> is equal to 0, the value is clipped to the minimum and maximum 
     *  limits.</p>
     * 
     *  <p>The valid values for a range are defined by the sum of the <code>minimum</code> property
     *  with multiples of the <code>interval and also defined to be less than or equal to the
     *  <code>maximum</code> property.
     * 
     *  The maximum need not be a multiple of <code>snapInterval</code>.</p>
     * 
     *  <p>For example, if <code>minimum</code> is equal to 1, <code>maximum</code> is equal to 6,
     *  and <code>snapInterval</code> is equal to 2, the valid
     *  values for the Range are 1, 3, 5, 6.
     * 
     *  Similarly, if <code>minimum</code> is equal to 2, <code>maximum</code> is equal to 9,
     *  and <code>snapInterval</code> is equal to 1.5, the valid
     *  values for the Range are 2, 3.5, 5, 6.5, 8, and 9.</p>
     * 
     *  @param value The input value.
     *  @param interval The value of snapInterval or an integer multiple of snapInterval.
