---
name: "macroLimits"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/macroLimits"
---

# macroLimits(3clc)

Macros for math limits.

## NAME

Macros\_and\_Limits - Macros for math limits.

## DESCRIPTION

The macro names given in the following list must use the values specified. These constant expressions are suitable for use in #if preprocessing directives.

| | |
| --- | --- |
| #define FLT\_DIG | 6 |
| #define FLT\_MANT\_DIG | 24 |
| #define FLT\_MAX\_10\_EXP | +38 |
| #define FLT\_MAX\_EXP | +128 |
| #define FLT\_MIN\_10\_EXP | -37 |
| #define FLT\_MIN\_EXP | -125 |
| #define FLT\_RADIX | 2 |
| #define FLT\_MAX | 0x1.fffffep127f |
| #define FLT\_MIN | 0x1.0p-126f |
| #define FLT\_EPSILON | 0x1.0p-23f |

The macro names given in the following list (available if the double option is supported) must use the values specified. These constant expressions are suitable for use in #if preprocessing directives.

| | |
| --- | --- |
| #define DBL\_DIG | 15 |
| #define DBL\_MANT\_DIG | 53 |
| #define DBL\_MAX\_10\_EXP | +308 |
| #define DBL\_MAX\_EXP | +1024 |
| #define DBL\_MIN\_10\_EXP | -307 |
| #define DBL\_MIN\_EXP | -1021 |
| #define DBL\_MAX | 0x1.fffffffffffffp1023 |
| #define DBL\_MIN | 0x1.0p-1022 |
| #define DBL\_EPSILON | 0x1.0p-52 |

The macro names given in the following list must use the values specified. These constant expressions are suitable for use in #if preprocessing directives. An application that wants to use **half** and **half***n* types will need to include the #pragma OPENCL EXTENSION [**cl\_khr\_fp16**(3clc)](/cl_khr_fp16/3clc.md) : enable directive.

| | |
| --- | --- |
| #define HALF\_DIG | 3 |
| #define HALF\_MANT\_DIG | 11 |
| #define HALF\_MAX\_10\_EXP | +4 |
| #define HALF\_MAX\_EXP | +16 |
| #define HALF\_MIN\_10\_EXP | -4 |
| #define HALF\_MIN\_EXP | -13 |
| #define HALF\_MAX | 0x1.ffcp15h |
| #define HALF\_MIN | 0x1.0p-14h |
| #define HALF\_EPSILON | 0x1.0p-10h |

The macro names given in the following list must use the values specified. These constant expressions are suitable for use in #if preprocessing directives.

| | |
| --- | --- |
| #define CHAR\_BIT | 8 |
| #define CHAR\_MAX | SCHAR\_MAX |
| #define CHAR\_MIN | SCHAR\_MIN |
| #define INT\_MAX | 2147483647 |
| #define INT\_MIN | (-2147483647- 1) |
| #define LONG\_MAX | 0x7fffffffffffffffL |
| #define LONG\_MIN | (-0x7fffffffffffffffL- 1) |
| #define SCHAR\_MAX | 127 |
| #define SCHAR\_MIN | (-127 - 1) |
| #define SHRT\_MAX | 32767 |
| #define SHRT\_MIN | (-32767- 1) |
| #define UCHAR\_MAX | 255 |
| #define USHRT\_MAX | 65535 |
| #define UINT\_MAX | 0xffffffff |
| #define ULONG\_MAX | 0xffffffffffffffffUL |

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**mathFunctions**(3clc)](/mathFunctions/3clc.md), [**mathConstants**(3clc)](/mathConstants/3clc.md), [**FP\_CONTRACT**(3clc)](/FP_CONTRACT/3clc.md), [**scalarDataTypes**(3clc)](/scalarDataTypes/3clc.md), [**vectorDataTypes**(3clc)](/vectorDataTypes/3clc.md), [**reservedDataTypes**(3clc)](/reservedDataTypes/3clc.md), [**otherDataTypes**(3clc)](/otherDataTypes/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2011 The Khronos Group Inc.\
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.

## NOTES

- 1\.

  OpenCL Specification

  page 252, section 6.12.2.1 - Floating-point macros and pragmas
