From wangtong at usc.edu  Tue Apr  3 10:37:23 2007
From: wangtong at usc.edu (Tong Wang)
Date: Tue, 03 Apr 2007 01:37:23 -0700
Subject: [Rd] Strange number produced by dnorm
Message-ID: <dc3f83df14128.4611afd3@usc.edu>

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 <R.h>
#include <Rdefines.h>    
#include <Rmath.h>

SEXP test( ) {
  double x;
  x=dnorm(1.0,0.0,1.0,1);
  printf(" x value is: %d \n",x);
  return(R_NilValue);
}

   I got the result :    x value is: -466460838 

Could someone explain to me what was wrong here ?

Thanks a lot. 

tong



[Rd] Strange number produced by dnorm
Tong Wang