Section 8. Processing and Math Instructions
8-33
The XOR operator also performs a bit-wise comparison of identically
positioned bits in two numeric expressions and sets the corresponding bit in
result according to the following truth table:
If bit in expr1 is
And bit in expr2 is
The result is
0
0
0
0
1
1
1
0
1
1
1
0
XOR Operator Example
The example sets the variable Msg based on the value of variables A, B, and C,
assuming that no variable is a Null. If A = 10, B = 8, and C = 11, the left
expression is True and the right expression is False. Because only one
comparison expression is True, the XOR expression evaluates True.
Dim A, B, C
'Declare variables.
A = 10: B = 8: C = 11
'Assign values.
If A > B XOR B > C Then
'Evaluate expressions.
Msg = True
Else
Msg = False.
End If
Derived Math Functions
The following is a list of nonintrinsic mathematical functions that can be
derived from the intrinsic math functions provided with CRBasic:
Function
CRBasic equivalent
Secant
Sec = 1 / Cos(X)
Cosecant
Cosec = 1 / Sin(X)
Cotangent
Cotan = 1 / Tan(X)
Inverse Secant
Arcsec = Atn(X / Sqr(X * X - 1)) + Sgn(Sgn(X) -1) *
1.5708
Inverse Cosecant
Arccosec = Atn(X/Sqr(X * X - 1)) + (Sgn(X) - 1) * 1.5708
Inverse Cotangent
Arccotan = Atn(X) + 1.5708
Hyperbolic Secant
HSec = 2 / (Exp(X) + Exp(-X))
Hyperbolic Cosecant
HCosec = 2 / (Exp(X) - Exp(-X))
Hyperbolic Cotangent
HCotan = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X))
Inverse Hyperbolic Sine
HArcsin = Log(X + Sqr(X * X + 1))
Inverse Hyperbolic Cosine
HArccos = Log(X + Sqr(X * X - 1))
Inverse Hyperbolic Tangent
HArctan = Log((1 + X) / (1 - X)) / 2
Inverse Hyperbolic Secant
HArcsec = Log((Sqr(-X * X + 1) + 1) / X)
Inverse Hyperbolic Cosecant
HArccosec = Log((Sgn(X) * Sqr(X * X + 1) +1) / X)
Inverse Hyperbolic Cotangent HArccotan = Log((X + 1) / (X - 1)) / 2
Logarithm
LogN = Log(X) / Log(N)
Содержание CR5000
Страница 39: ...Section 1 Installation and Maintenance 1 15 S A N Y O FIGURE 1 11 6 Removal of band clamp and battery ...
Страница 40: ...Section 1 Installation and Maintenance 1 16 This is a blank page ...
Страница 54: ...Section 2 Data Storage and Retrieval 2 14 This is a blank page ...
Страница 88: ...Section 4 CRBasic Native Language Programming 4 12 This is a blank page ...
Страница 94: ...Section 5 Program Declarations 5 6 This is a blank page ...
Страница 172: ...Section 7 Measurement Instructions 7 46 This is a blank page ...
Страница 206: ......
Страница 236: ...Index Index 4 This is a blank page ...
Страница 237: ...This is a blank page ...