Campbell CR800 Specifications Page 219

  • Download
  • Add to my manuals
  • Print
  • Page
    / 324
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 218
Section 8. Processing and Math Instructions
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
Ln (Source)
Log (Source)
Returns the natural logarithm of a number. Ln and Log perform the same
function.
Syntax
x = Log (source)
x = Ln (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
x = LOG10 (number)
Remarks
The LOG10 function returns the logarithm base 10 of a number.
8-17
Page view 218
1 2 ... 214 215 216 217 218 219 220 221 222 223 224 ... 323 324

Comments to this Manuals

No comments