-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEMInterface.h
More file actions
executable file
·88 lines (73 loc) · 1.97 KB
/
Copy pathEMInterface.h
File metadata and controls
executable file
·88 lines (73 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// CalculatorModel.h
//
// Copyright (c) 2000 Sven Van Caekenberghe. All rights reserved.
// For more info: http://homepage.mac.com/svc/carbon-objc-mac-os-x/ - mailto:svc@mac.com
//
#import <Foundation/Foundation.h>
typedef enum _CalculatorOpCode
{
NO_OPERATOR = 0,
DIVIDE_OPERATOR = 1,
MULTIPLY_OPERATOR = 2,
ADD_OPERATOR = 3,
SUBTRACT_OPERATOR = 4,
EXPONENT_OPERATOR = 5,
XROOT_OPERATOR = 6,
MOD_OPERATOR = 7,
EE_OPERATOR = 8,
NPR_OPERATOR = 9,
NCR_OPERATOR = 10
} CalculatorOpCode;
typedef enum _AngleType
{
DEGREE = 0,
RADIAN = 1,
GRADIENT = 2
} AngleType;
@interface CalculatorModel : NSObject
{
double accumulatorValue; // holds the working number (which is being edited)
double transientValue; // holds other operand (previous accumulator)
double e_value; // the number e
CalculatorOpCode operatorCode; // holds the current operator
AngleType angle_type; // holds type of angles used
int trailingDigits; // used in decimal number input
BOOL startNewDigit; // used in decimal number input
}
- (double)accumulator;
- (void)setAccumulator:(double)newValue;
- (NSDictionary *)state;
- (void)setState:(NSDictionary *)stateDictionary;
- (void)pi;
- (void)e;
- (void)dot;
- (void)clear;
- (void)enter;
- (void)percentage;
- (void)invert;
- (void)inverse;
- (void)sqrtOperator;
- (void)cubed_root;
- (double)deg_to_rad:(double)degrees;
- (double)grad_to_rad:(double)gradients;
- (void)sine;
- (void)cosine;
- (void)tangent;
- (void)arcsine;
- (void)arccosine;
- (void)arctangent;
- (void)ln;
- (void)logarithm;
- (double)recursive_factorial:(double)n;
- (void)factorial;
- (void)powerE;
- (void)power10;
- (void)squared;
- (void)cubed;
- (double) generate_random_num;
- (void)random_num;
- (void)setAngleType:(AngleType)aType;
- (void)acceptOperator:(CalculatorOpCode)opCode;
- (void)newDigit:(int)digit;
@end