Implement degree mode in DeskCalc.
Default is radian mode, You set the option in the right click menu like the other options. Note: degree mode does not affect hyperbolic trigonometric functions. This is how Mac Calculator, Windows Calculator, and Google Calculator work.
This commit is contained in:
@@ -42,6 +42,9 @@ class ExpressionParser {
|
||||
ExpressionParser();
|
||||
~ExpressionParser();
|
||||
|
||||
bool DegreeMode();
|
||||
void SetDegreeMode(bool degrees);
|
||||
|
||||
void SetSupportHexInput(bool enabled);
|
||||
|
||||
BString Evaluate(const char* expressionString);
|
||||
@@ -49,7 +52,6 @@ class ExpressionParser {
|
||||
double EvaluateToDouble(const char* expressionString);
|
||||
|
||||
private:
|
||||
|
||||
MAPM _ParseBinary();
|
||||
MAPM _ParseSum();
|
||||
MAPM _ParseProduct();
|
||||
@@ -64,6 +66,8 @@ class ExpressionParser {
|
||||
void _EatToken(int32 type);
|
||||
|
||||
Tokenizer* fTokenizer;
|
||||
|
||||
bool fDegreeMode;
|
||||
};
|
||||
|
||||
#endif // EXPRESSION_PARSER_H
|
||||
|
||||
Reference in New Issue
Block a user