FunctionNatural logarithm
Syntax C/C++#include <VFmath.h>
int VF_log( fVector Y, fVector X, ui size );
int VFx_log( fVector Y, fVector X, ui size, float A, float B, float C );
int VPF_logtoC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::log( const vector<T>& X );
int vector<T>::x_log( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<complex<T>>::logtoC( const vector<polar<T>>& X );
Pascal/Delphiuses VFmath;
function VF_log( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_log( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VPF_logtoC( Y:cfVector; X:pfVector; size:UIntSize ): IntBool;
Descriptionnormal versions: Yi = ln( Xi )
expanded versions: Yi = C * ln( A*Xi+B )
The "logarithmus naturalis", i.e. the logarithm to the basis of Euler's constant e is calculated.
The logarithm of polar complex numbers is most naturally stored in cartesian format, as log{Mag@Arg} = {Mag,Arg}. Therefore, the VPF_ version exists only with the result in a cfVector.
Error handlingReal versions: DOMAIN errors occur in the case of negative Xi (including -0.0), with NAN ("not-a-number") as the default result. SING errors occur for Xi= +0.0 and yield a result of -HUGE_VAL. In the complex version, numbers with an imaginary part of zero are always treated as real numbers; therefore, an argument {0, 0} is treated as a real 0, causing a SING error with the default result {-HUGE_VAL, 0}.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_exp,   VF_log2,   VF_log10,   VF_pow,   log

VectorLib Table of Contents  OptiVec home