Description

The following symbolic constants are available. Their values are of type float and are accurate within the precision of a single precision floating-point number.

Constant Name

Description

MAXFLOAT

Value of maximum non-infinite single-precision floating-point number.

HUGE_VALF

A positive float constant expression. HUGE_VALF evaluates to +infinity. Used as an error value returned by the built-in math functions.

INFINITY

A constant expression of type float representing positive or unsigned infinity.

NAN

A constant expression of type float representing a quiet NaN.

If double precision is supported by the device, e.g. for OpenCL C 3.0 or newer the __opencl_c_fp64 feature macro is present, the following symbolic constants will also be available:

Constant Name

Description

HUGE_VAL

A positive double constant expression. HUGE_VAL evaluates to +infinity. Used as an error value returned by the built-in math functions.

See Also

Document Notes

For more information, see the OpenCL C Specification

This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0