HTBasic Help
×
Menu
Index
Tolog
Conversion from linear to logarithmic representation.
 
Loading        LOADSUB ALL FROM "TOLOG.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB Tolog FROM "MATHLIB.HTS"
 
Usage                REAL A(*),B(*),X
CALL Tolog(A(*),X,B(*))
 
Description                
Tolog converts the data in the array A into logarithmic representation and returns the results in the array B. The factor x is used to scale the data in the array A after it is converted; each point in A is multiplied by x after conversion is done. Tolog is usually used to convert data to decibel representation. Tolog is equivalent to the following BASIC lines
 
INTEGER I
FOR I=1 TO size(A)
B(I)=LOG(A(I))*X
NEXT I
 
where size(A) is the number of elements in the array A. In most cases, x is either 10 or 20.
 
Errors                
Tolog causes an HTBasic error if its arguments are not all of type REAL or if A and B do not have the same number of elements.