From: Lynette <fuyaonv_at_hotmail.com>

Date: Sun 21 Jan 2007 - 23:24:13 GMT

R-help@stat.math.ethz.ch 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. Received on Mon Jan 22 10:29:01 2007

Date: Sun 21 Jan 2007 - 23:24:13 GMT

void func( double *x, int n, void *ex )

*{
*

int i;

for(i=0;i<n;i++) { x[i]=( ((x>=1/4)&&(x<=3/4)) ? 2:1 ) ; }

while the following one when integrated from 0 to 1 gives the correct 0.7853983

void func( double *x, int n, void *ex )

*{
*

int i;

for(i=0;i<n;i++) { x[i]= pow(1-x[i]*x[i],.5); }

Please advise the problems. Thanks a lot.

R-help@stat.math.ethz.ch 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. Received on Mon Jan 22 10:29:01 2007

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Mon 22 Jan 2007 - 19:31:49 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*