OpenCL-Docs icon indicating copy to clipboard operation
OpenCL-Docs copied to clipboard

Ambiguous description of `CL_FLT_MIN`, etc.

Open bashbaug opened this issue 2 months ago • 0 comments

The description of CL_FLT_MIN (and CL_DBL_MIN / CL_HALF_MIN) is currently:

Minimum value of type cl_float

"Minimum value" in this case could refer to the smallest floating-point value (meaning, a positive value closest to zero) or the most negative floating-point value (meaning, the value closest to negative infinity). We should clarify this.

In the headers, this is a positive value closest to zero:

https://github.com/KhronosGroup/OpenCL-Headers/blob/6137cfbbc7938cd43069d45c622022572fb87113/CL/cl_platform.h#L192

#define CL_FLT_MIN          1.175494350822287507969e-38f

The description in cppreference (for the analogous FLT_MIN) is:

https://en.cppreference.com/w/cpp/types/climits.html

minimum normalized positive value of float, double and long double respectively

bashbaug avatar Oct 21 '25 15:10 bashbaug