By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,402 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,402 IT Pros & Developers. It's quick & easy.

Missing erf()

P: n/a
Is there a reason why erf() is not included in the math package?

According to the following URL it looks like it has been standard C
since 1999.

http://www.opengroup.org/onlinepubs/...tions/erf.html

Dec 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

rrenaudIs there a reason why erf() is not included in the math
rrenaudpackage? According to the following URL it looks like it has
rrenaudbeen standard C since 1999.

Python is implemented in the C89 dialect. Maybe Python 3.0 will be
implemented using C99.

Skip
Dec 31 '06 #2

P: n/a
On Sun, 2006-12-31 at 13:23 -0600, sk**@pobox.com wrote:
rrenaudIs there a reason why erf() is not included in the math
rrenaudpackage? According to the following URL it looks like it has
rrenaudbeen standard C since 1999.

Python is implemented in the C89 dialect. Maybe Python 3.0 will be
implemented using C99.
In the meantime, you could:

1) Patch mathmodule.c to add the missing function(s), or
2) Make a small extension module that exposes the missing function(s),
or
3) Use ctypes to access libm directly. Something along the lines of
this:
>>from ctypes import *
libm = CDLL("libm.so")
libm.erf.restype = c_double
libm.erf(c_double(0))
0.0
>>libm.erf(c_double(1))
0.84270079294971489
>>libm.erf(c_double(2))
0.99532226501895271

Hope this helps,

Carsten.
Jan 1 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.