package net.sf.jranges.range;

import net.sf.jranges.range.doublerange.DoubleRange;
import net.sf.jranges.range.integer.IntegerRange;

public class RangeUtils {
	
	public interface IntegerRangeCallback {
		void call(int i);
	}
	
	public interface DoubleRangeTask {
		void call(double d);
	}
	
	private RangeUtils(){}
	
	public static void doForAllInRange(IntegerRange range, IntegerRangeCallback task){
		for(int i = range.getStart(); i <= range.getStop(); i+= range.getInterval()){
			task.call(i);
		}
	}
	
	public static void doForAllInRange(DoubleRange range, DoubleRangeTask task){
		for(double i = range.getStart(); i <= range.getStop(); i+= range.getInterval()){
			task.call(i);
		}
	}

}

@@ -126,16 +126,59 @@
 erRange;
+%0Aimport net.sf.kerner.utils.math.MathUtils;
 %0A%0Apublic
@@ -650,33 +650,53 @@
 nge.getStart(); 
-i
+MathUtils.round(i, 6)
  %3C= range.getSto

fix rounding error.