forked from swinton/calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
It would be cool if the calculator provided a way to calculate factorials, e.g.
| n | n! |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
It looks like we just need to expose a new factorial function here:
calculator/api/controllers/arithmeticController.js
Lines 13 to 18 in a1c403b
| var operations = { | |
| 'add': function(a,b) { return +a + +b }, | |
| 'subtract': function(a,b) { return a - b }, | |
| 'multiply': function(a,b) { return a * b }, | |
| 'divide': function(a,b) { return a / b }, | |
| }; |
Reactions are currently unavailable