On Mon, 22 Jan 2007, Lynette wrote:
> Dear all, especially to Thomas,
>
> I have figured out the problem. For the step function, something wrong with
> my C codes. I should use the expression ((x>=0.25)&&(x<=0.75)) ? 2:1 instead
> of ((x>=1/4)&&(x<=3/4)) ? 2:1 ). Have no idea why 0.25 makes difference from
> 1/4 in C. But now I can go ahead with the correct integration in C. Thank you
> all. And hope this helps to others.
>
1 and 4 are ints in C, so 1/4 is 0 (integer division).
-thomas
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.