/*

http://xahlee.org/tree/tree.html
Xah Lee, 2005-06
*/


import java.util.List;
import java.util.ArrayList;
import java.lang.Math;

class math {
    public static List range(double n) {
        return range(1,n,1);
    }

    public static List range(double n, double m) {
        return range(n,m,1);
    }

    public static List range(double iMin, double iMax, double iStep) {
        List ll = new ArrayList();
        if (iMin <= iMax && iStep > 0) {
            for (int i=0; i <= Math.floor((iMax-iMin)/iStep); i++) {
                ll.add(new Double(iMin+i*iStep));
            }
            return ll;
        }
        if (iMin >= iMax && iStep < 0) {
            for (int i=0; i <= Math.floor((iMin-iMax)/-iStep); i++) {
                ll.add(new Double(iMin+i*iStep));
            }
            return ll;
        }
        // need to raise exception here
        return ll;
    }
}

class Range {
    public static void main(String[] arg) {
        System.out.println(math.range(5));
        System.out.println(math.range(5,10));
        System.out.println(math.range(5,7, 0.3));
        System.out.println(math.range(5,-4, -2));
    }
}