Hey does anyone know if there is an error function in the math library of C++? I think there is so, but I just can't figure out how to use it.
Yaserk88
0
Light Poster
Recommended Answers
Jump to PostYes:
The 2001 ANSI standard added the erfc function ( 1-erf(x) ), for float/double/long double.
Not 100% sure when that got built into most version of cmath and math.h. But by now almost every compiler should have it, and should have had it for nearly 8-9 years.
Certainly …
Jump to PostHi
I didn't found any error function when I was searching the compilers (gcc, visual c, watcom). Therefore, I took an approximation from Abramowitz/Stegun and wrote my own erf(x). It's approximation error is about 10^(-7). which was almost always sufficient for my apps. erf(x) = 1-erfc(x).
All 5 Replies
StuXYZ
731
Practically a Master Poster
Yaserk88
0
Light Poster
tesuji
135
Master Poster
munur93
0
Newbie Poster
tesuji
135
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.