blob: 4703e9a2e366b58ce784493888d832604d8a4e34 [file] [log] [blame]
<para>
<!-- core spec p. 241, section 6.12.2 --> The vector versions of the math functions operate
component-wise. The description is per-component.
</para>
<para>
The built-in math functions are not affected by the prevailing rounding mode in the calling
environment, and always return the same value as they would if called with the round to
nearest even rounding mode.
</para>
<para>
The built-in math functions take scalar or vector arguments. For any specific use of these
function, the actual type has to be the same for all arguments and the return type unless
otherwise specified.
</para>
<para>
The generic type name <type>gentype</type> is used to indicate that the function can
take <type>float</type>, <type>float2</type>, <type>float3</type>, <type>float4</type>,
<type>float8</type>, <type>float16</type>, <type>double</type>, <type>double2</type>,
<type>double3</type>, <type>double4</type>, <type>double8</type>, or <type>double16</type>
as the type for the arguments.
</para>
<para>
If extended with <citerefentry><refentrytitle>cl_khr_fp16</refentrytitle></citerefentry>,
generic type name <type>gentype</type> may indicate <type>half</type> and
<type>half{2|3|4|8|16}</type> as arguments and return values.
</para>
<para>
The generic type name <type>gentypef</type> is used to indicate that the function can
take <type>float</type>, <type>float2</type>, <type>float3</type>, <type>float4</type>,
<type>float8</type>, or <type>float16</type> as the type for the arguments.
</para>
<para>
The generic type name <type>gentyped</type> is used to indicate that the function can take
<type>double</type>, <type>double2</type>, <type>double3</type>, <type>double4</type>,
<type>double8</type>, or <type>double16</type> as the type for the arguments.
</para>
<!-- 12-Oct-2011 -->