Section 8. Processing and Math Instructions
8-15
Dim A, B, C, D
'Declare variables.
BeginProg
A = Int(-99.8)
'Returns -100
B = Fix(-99.8)
'Returns -99
C = Int(99.8)
'Returns 99
D = Fix(99.8)
'Returns 99
EndProg
Log (Source)
Returns the natural logarithm of a number.
Syntax
x = Log (source)
Remarks
The source can be any valid numeric expression that results in a value greater
than 0. The natural logarithm is the logarithm to the base e. The constant e is
approximately 2.718282.
You can calculate base-n logarithms for any number x by dividing the natural
logarithm of x by the natural logarithm of n as follows:
Logn(x) = Log(x) / Log(n)
The following example illustrates a procedure that calculates base-10
logarithms:
Log10 = Log(X) / Log(10)
Log Function Example
The example calculates the value of e, then uses the Log function to calculate
the natural logarithm of e to the first, second, and third powers.
Dim I, M
'Declare variables.
BeginProg
M = Exp(1)
For I = 1 To 3
'Do three times.
M =Log(Exp(1) ^ I)
Next I
EndProg
LOG10 (number)
The LOG10 function returns the base 10 logarithm of a number.
Syntax
LOG10( number )
Remarks
The LOG10 function returns the logarithm base 10 of a number.
The Number argument can be any valid numeric expression that has a value
greater than 0. You can calculate base-n logarithms for any number x by
dividing the logarithm base 10 of x by the logarithm base 10 of n as follows:
Содержание 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 ...