'Angular - How to build calculator with mathematical opeartions and trignomatic operations?
I want to build on calculator in Angular. I want to implement Trigonometric operations in my calculator any suggestion how to implement Trigonometric operations?
Here is my .ts file
doCalculation(op: any , secondOp: any){
switch (op){
case '+': {
return this.firstOperand += secondOp;
}
case '-': {
return this.firstOperand -= secondOp;
}
case '*': {
return this.firstOperand *= secondOp;
}
case '/': {
return this.firstOperand /= secondOp;
}
case '=':{
return secondOp;
}
default:
}
}
Can I perform Trigonometric operations in switch case statement in my code. If yes please let me know how and any alternative suggestion welcome. Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
