C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

erf() / erfc() function under Visual C++ 6

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
simone
Guest





PostPosted: Fri Nov 19, 2004 2:53 pm    Post subject: erf() / erfc() function under Visual C++ 6 Reply with quote



Hello everybody.
I'm need to include the mathematical function erf and erfc in my code
under Visual C++. I don't found them in the math.h provided by Visual
C++, while I'm sure that the ANSI standard math.h have these function.
How could I tackle this lack??

Thanks in advance
Simone

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Thomas Richter
Guest





PostPosted: Fri Nov 19, 2004 4:48 pm    Post subject: Re: erf() / erfc() function under Visual C++ 6 Reply with quote



Hi,

Quote:
I'm need to include the mathematical function erf and erfc in my code
under Visual C++. I don't found them in the math.h provided by Visual
C++, while I'm sure that the ANSI standard math.h have these function.
How could I tackle this lack??

Check for the GNU scientific library, it contains also the error function
and lots more:

http://www.gnu.org/software/gsl/

So long,
Thomas


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Victor Bazarov
Guest





PostPosted: Sat Nov 20, 2004 10:36 am    Post subject: Re: erf() / erfc() function under Visual C++ 6 Reply with quote



simone wrote:
Quote:
I'm need to include the mathematical function erf and erfc in my code
under Visual C++. I don't found them in the math.h provided by Visual
C++, while I'm sure that the ANSI standard math.h have these function.

What exactly makes you so sure? C99 added those functions, but C++ is
not based on C99. C++ is based on C90, which does not define 'erf' or
'erfc'.

Quote:
How could I tackle this lack??

You could add your own header that will declare those functions (like
they are declared in C99's <math.h>) and then make sure you link with
a new implemenation of C99's math library, but you _can_ be running
into some problems while doing that since the C90 run-time will be also
linked in, most likely.

I recommend finding the source for those functions, compile (assemble)
them separately, and add as an object file[s] to your program.

V

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
TOM
Guest





PostPosted: Sun Nov 21, 2004 3:15 am    Post subject: Re: erf() / erfc() function under Visual C++ 6 Reply with quote

Be sure to test erfc() pretty carefully - many implementations are not
accurate when the argument is greater than or equal to +6. For
example MS Excel (probably due to single precision).

erfc() can and should return values like 10^-17 for values of
the argument near 6.

-- Tom

"simone" <simogasp (AT) tin (DOT) it> wrote

Quote:
Hello everybody.
I'm need to include the mathematical function erf and erfc in my code
under Visual C++. I don't found them in the math.h provided by Visual
C++, while I'm sure that the ANSI standard math.h have these function.
How could I tackle this lack??
[excess quoting deleted -- mod]


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.