How to use erfc() function to get the complementary error function value for N in C++

1 Answer

0 votes
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	cout << "erfc(-1) = " << erfc(-1) << endl;
	cout << "erfc(1) = " << erfc(1) << endl;
	cout << "erfc(0) = " << erfc(0) << endl;
	cout << "erfc(-0) = " << erfc(-0) << endl;

	return 0;
}

/*
run:

erfc(-1) = 1.8427
erfc(1) = 0.157299
erfc(0) = 1
erfc(-0) = 1

*/

 



answered Mar 15, 2016 by avibootz
...