log

> # NAME

> log - returns the natural logarithm of scalars and vectors

> # SYNOPSIS

>       float  log(float a);
>       float1 log(float1 a);
>       float2 log(float2 a);
>       float3 log(float3 a);
>       float4 log(float4 a);

>       half   log(half a);
>       half1  log(half1 a);
>       half2  log(half2 a);
>       half3  log(half3 a);
>       half4  log(half4 a);

>       fixed  log(fixed a);
>       fixed1 log(fixed1 a);
>       fixed2 log(fixed2 a);
>       fixed3 log(fixed3 a);
>       fixed4 log(fixed4 a);

> # PARAMETERS

> a

>   Vector or scalar of which to determine the natural logarithm.

> # DESCRIPTION

> Returns the natural logarithm a.

> For vectors, the returned vector contains the natural logarithm of each element of the input vector.

> # REFERENCE IMPLEMENTATION

>       float3 log(float3 a)
>       {
>         float3 rv;
>         int i;

>         for (i=0; i<3; i++) {
>           rv[i] = log(a[i]);  // this is the ANSI C standard library log()
>         }
>         return rv;
>       }

> log is typically implemented with a native base-2 logarithm instruction.

> # PROFILE SUPPORT

> log is fully supported in all profiles unless otherwise specified.

> Support in the fp20 is limited to constant compile-time evaluation.

> # SEE ALSO

> exp, log10, log2, pow