I tried to make a Gaussian code, but the compiler gave conflicting types error. I cannot figure out why this happen.
Code:#include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int i; double kk; srand(time(NULL)); i = rand(); kk = myGaussian(i); printf ("Your random number is %f\n", kk); return(0); } double myGaussian(int x){ double random_max = 32767; //max int that generate by rand double half_random_max = 32767/2; double varianece_value = 89481216; //vairance from 0:32767 double std_value = 9459.451; //std from 0:32767 double temp; temp = ((1/sqrt(2*pi))*(1/std_value))*exp(-(x-half_random_max)^2/(2*varianece_value)); return temp; }
==============================
Except the XOR problem, the code still has the conflicting type error. Please help