<!-- section 6.13.2 Math Functions --> | |
<para> | |
General information about built-in math functions: | |
The built-in math functions are categorized into the following: | |
</para> | |
<para> | |
<itemizedlist> | |
<listitem>A list of built-in functions that have scalar or vector argument versions, and,</listitem> | |
<listitem>A list of built-in functions that only take scalar float arguments.</listitem> | |
</itemizedlist> | |
</para> | |
<para> | |
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> | |
<!-- 28-Oct-2015, C lang ver 2.0 rev 30 --> | |