How to use erf() function to get the error function value for N in C

1 Answer

0 votes
#include <stdio.h>     
#include <math.h>
 
int main(int argc, char **argv)
{
	printf("erf(-1) = %.6f\n", erf(-1));
    printf("erf(1) = %.6f\n", erf(1));
    printf("erf(0) = %.6f\n", erf(0));
	printf("erf(-0) = %.6f\n", erf(-0));

    return 0;
}

/*
run:
  
erf(-1) = -0.842701
erf(1) = 0.842701
erf(0) = 0.000000
erf(-0) = 0.000000

*/

 



answered Mar 15, 2016 by avibootz
...