fract
提供: Tommy6
型名 gentype を、組み込みデータ型 float, float2, float3(OpenCL 1.1 で追加), float4, float8, float16 を指すものとして用います。他に指定されている場合を除き、関数を使用する際の引数および戻り値の型は全て同じです。
gentype fract (gentype x, __global gentype *iptr)[1] gentype fract (gentype x, __local gentype *iptr) gentype fract (gentype x, __private gentype *iptr)
fmin(x - floor(x), 0x1.fffffep-1f) を返します。iptr に floor(x) が返されます。
変更記録
脚注
- ↑ The min() operator is there to prevent fract(-small) from returning 1.0. It returns the largest positive floating-point number less than 1.0.
―――― Version 1.1, The OpenCL Specification
より翻訳