Skip to content

Commit

Permalink
MAKE THE OTHER FUNCTIONS RANDOM TOO
Browse files Browse the repository at this point in the history
IT'S VERY RANDOM AND COOL

GREETINGS

FIXES #6

YO HAVE A NICE DAY
  • Loading branch information
Haroenv authored and mischah committed Dec 4, 2016
1 parent cd8c5ad commit d4d750a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
}

var changeSign = function () {
renderOutput(Number(getInput()) * -1);
var base = - Math.random() * 10;
renderOutput(Number(getInput()) * base);
if (storage.lastClick !== 'number') {
storage.operands.pop();
storage.operands.push(Number(getInput()));
Expand All @@ -95,7 +96,8 @@
};

var percentage = function () {
renderOutput(Number(getInput()) / 100);
var base = Math.pow(Math.random(), 2);
renderOutput(Number(getInput()) / base);
if (storage.lastClick !== 'number') {
storage.operands.pop();
storage.operands.push(Number(getInput()));
Expand Down

0 comments on commit d4d750a

Please sign in to comment.