Having a hard time picking up C :( Thanks a lot for all your time .
tong
- Original Message -
From: Peter Dalgaard <[EMAIL PROTECTED]>
Date: Wednesday, April 4, 2007 12:44 am
Subject: Re: [Rd] Strange number produced by dnorm
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R-de
Tong Wang wrote:
> Hi All,
> I just started to learn compiling C codes for R usage, and got a problem
> when I was playing with my 'hello world' code.
>
> #include
> #include
> #include
>
> SEXP test( ) {
> double x;
> x=dnorm(1.0,0.0,1.0,1);
> printf(" x value is: %d \n",x);
On Tue, 3 Apr 2007, Tong Wang wrote:
> Hi All,
>I just started to learn compiling C codes for R usage, and got a
> problem when I was playing with my 'hello world' code.
>
> #include
> #include
> #include
>
> SEXP test( ) {
> double x;
> x=dnorm(1.0,0.0,1.0,1);
> printf(" x value is: %
Hi,
I think the only thing that's wrong is "%d" in your printf statement,
shouldn't it be "%f"? ("%d" is used for decimal (integer) numbers, "%f"
for float (double) numbers)
Regards,
Martin
Tong Wang wrote:
> Hi All,
> I just started to learn compiling C codes for R usage, and got a pro