The R Project SVN R

Rev

Rev 68947 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68947 Rev 69175
Line 37... Line 37...
37
} SEG, *SEGP;
37
} SEG, *SEGP;
38
 
38
 
39
 
39
 
40
static int ctr_intersect(double z0, double z1, double zc, double *f)
40
static int ctr_intersect(double z0, double z1, double zc, double *f)
41
{
41
{
42
/*  Old test was  ((z0 - zc) * (z1 - zc) < 0.0), but rounding led to inconsistencies 
42
/*  Old test was  ((z0 - zc) * (z1 - zc) < 0.0), but rounding led to inconsistencies
43
    in PR#15454 */
43
    in PR#15454 */
44
    if ( (z0 < zc) != (z1 < zc) && z0 != zc && z1 != zc ) { 
44
    if ( (z0 < zc) != (z1 < zc) && z0 != zc && z1 != zc ) {
45
	*f = (zc - z0) / (z1 -	z0);
45
	*f = (zc - z0) / (z1 -	z0);
46
	return 1;
46
	return 1;
47
    }
47
    }
48
    return 0;
48
    return 0;
49
}
49
}