Skip to content

Commit

Permalink
feat(intg): square given entry
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 23, 2022
1 parent 57c3f00 commit ca669b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/CalculatorContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function evaluateExpression(evaluationMethod: PossibleButtonValues) {
const quotient = 1 / Number(entryValue.value)
evaluationValue.value = `1/(${entryValue.value})`
entryValue.value = String(quotient)
break
}
case "": {
const sqr = Number(entryValue.value) * Number(entryValue.value)
evaluationValue.value = `sqr(${entryValue.value})`
entryValue.value = String(sqr)
break
}
}
Expand Down

0 comments on commit ca669b4

Please sign in to comment.