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 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).
Jump to PostHi munur93,
I am glad that my little erf() saved your time.
Unfortunately, MS visual c++ and other poor compilers do not have any Gaussian erfxcz function implemented to date despite the C99 standard provides some error functions in math.h. (Then I cribbed from famous Irene Stegun's Handbook …
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.