aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-19 16:28:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-19 16:28:43 -0700
commit9089dc78a6c7fd21be5fc115451996018779dd40 (patch)
treeb105c3f9c7a4b2a0add1328d5e4c1faec2f3ecc3
parent9e666300844804758187b15845c32fd24d7fb830 (diff)
add erf dep and testing
-rw-r--r--src/library.js1
-rwxr-xr-xtests/runner.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index 1ba4f2fa..939da8b1 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5439,6 +5439,7 @@ LibraryManager.library = {
return (ONE_SQRTPI * Math.exp(- x * x) * q2);
},
erfcf: 'erfcf',
+ erf__deps: ['erfc'],
erf: function (x) {
var MATH_TOLERANCE = 1E-12;
var TWO_SQRTPI = 1.128379167095512574;
diff --git a/tests/runner.py b/tests/runner.py
index 6b711939..c0e16632 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3056,11 +3056,12 @@ Exiting setjmp function, level: 0, prev_jmp: -1
main(void) {
float (*fn)(float) = &sqrtf;
float (*fn2)(float) = &fabsf;
- printf("fn2(-5) = %d, fn(10) = %f\\n", (int)fn2(-5), fn(10));
+ float (*fn3)(float) = &erff;
+ printf("fn2(-5) = %d, fn(10) = %.2f, erf(10) = %.2f\\n", (int)fn2(-5), fn(10), fn3(10));
return 0;
}
'''
- self.do_run(src, 'fn2(-5) = 5, fn(10) = 3.16')
+ self.do_run(src, 'fn2(-5) = 5, fn(10) = 3.16, erf(10) = 1.00')
def test_funcptrfunc(self):
src = r'''