diff --git a/README.md b/README.md index c908537..96eff7e 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,11 @@ Pop the value `a` and push its arc tangent. Pop two values `a` and `b` and push the arc tangent of `b / a`, using the signs of `a` and `b` to determine the quadrant. +### Error function + +`erf` +Pop the value `a` and push its error function. + ### Summation `sum` diff --git a/clac.1 b/clac.1 index 7ad8a18..ad6a412 100644 --- a/clac.1 +++ b/clac.1 @@ -116,6 +116,13 @@ Pop two values `a` and `b` and push the arc tangent of `b / a`, using the signs of `a` and `b` to determine the quadrant. .El . +.Ss Error function +. +.Bl -tag -width Fl +.It Ic erf +Pop the value `a` and push its error function. +.El +. .Ss Summation . .Bl -tag -width Fl diff --git a/clac.c b/clac.c index 49394bc..24d30bb 100644 --- a/clac.c +++ b/clac.c @@ -369,6 +369,10 @@ static void process(sds word) { if (count(s0) > 0) { push(s0, log10(pop(s0))); } + } else if (!strcasecmp(word, "erf")) { + if (count(s0) > 0) { + push(s0, erf(pop(s0))); + } } else if (!strcasecmp(word, "!")) { if (count(s0) > 0) { a = pop(s0);