「fract」の版間の差分

提供: Tommy6
移動: 案内検索
(ページの作成: {{Pathnav|OpenCL|OpenCLマニュアル|OpenCL C 言語|数学関数}} {{gentype math-function}} {{関数| gentype fract (gentype ''x'', __global gentype *''iptr'')<ref>...)
 
 
17行: 17行:
 
<references />
 
<references />
  
|[http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf Revision 33, Version 1.1, The OpenCL Specification]
+
|[http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf Version 1.1, The OpenCL Specification]
 
}}
 
}}
  

2011年5月11日 (水) 18:26時点における最新版

型名 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) を返します。iptrfloor(x) が返されます。

変更記録

脚注

  1. 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 より翻訳