Skip to content

Commit

Permalink
erf
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Tross committed Nov 17, 2019
1 parent 809562f commit 383753a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 7 additions & 0 deletions clac.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions clac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 383753a

Please sign in to comment.