Добавлены Операции и Константы. Изменено оформление формы, так как были отключены кнопки:

- Градусы;
- Радианы;
- Грады;
- Память ((MC, MR, MS, M-, M+);
- dms;
- F-E.
This commit is contained in:
Мария 2024-04-14 23:59:47 +03:00
parent a9be1638c3
commit a906568f42
8 changed files with 117 additions and 95 deletions

View file

@ -31,6 +31,8 @@ namespace calculator.Services
return Math.Pow(a, b);
case Operation.Mod:
return a % b;
case Operation.Log:
return Math.Log(a, b);
default:
throw new ArgumentException($"Invalid operator: {token}");
}
@ -75,16 +77,14 @@ namespace calculator.Services
return Math.Pow(a, 3);
case Operation.CubeRoot:
return Math.Pow(a, 1 / 3);
case Operation.Log:
return Math.Log10(a);
case Operation.Ln:
return Math.Log(a);
case Operation.Exp:
return Math.Exp(a);
case Operation.Inv:
return 1 / a;
case Operation.Pi:
return Math.PI;
case Operation.Int:
return Math.Round(a);
case Operation.PowX:
return Math.Pow(10, a);
default:
throw new ArgumentException($"Invalid operator: {token}");
}