Project

General

Profile

Bug #4576 ยป 0001-Fix-the-ronding-error-causing-wrong-evaluation-of-ra.patch

vo.x (Vit Ondruch), 08/30/2011 05:52 PM

View differences:

numeric.c
1639 1639
	double unit = NUM2DBL(step);
1640 1640
	double n = (end - beg)/unit;
1641 1641
	double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon;
1642
	double im = 0.0;
1642 1643
	long i;
1643 1644

  
1644 1645
	if (isinf(unit)) {
......
1647 1648
	else {
1648 1649
	    if (err>0.5) err=0.5;
1649 1650
	    n = floor(n + err);
1650
	    if (!excl || ((long)n)*unit+beg < end) n++;
1651
	    im = ((long)n)*unit+beg;
1652
	    if (!excl || im < end) n++;
1651 1653
	    for (i=0; i<n; i++) {
1652 1654
		rb_yield(DBL2NUM(i*unit+beg));
1653 1655
	    }
1654
-