'\" t .\" Title: Symbolic Math Constants .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/03/2019 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "SYMBOLIC MATH CONSTA" "3clc" "02/03/2019" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" Symbolic_Math_Constants \- The following symbolic constants are available\&. .SH "BUILT\-IN MATH CONSTANTS" .PP The following symbolic constants are available\&. Their values are of type \fBfloat\fR and are accurate within the precision of a single precision floating\-point number\&. .TS allbox tab(:); lB lB. T{ Constant Name T}:T{ Description T} .T& l l l l l l l l. T{ MAXFLOAT T}:T{ Value of maximum non\-infinite single\-precision floating\-point number\&. T} T{ HUGE_VALF T}:T{ A positive float constant expression\&. \fBHUGE_VALF\fR evaluates to +infinity\&. Used as an error value returned by the \fBmathFunctions\fR(3clc)\&. T} T{ INFINITY T}:T{ A constant expression of type \fBfloat\fR representing positive or unsigned infinity\&. T} T{ NAN T}:T{ A constant expression of type \fBfloat\fR representing a quiet NaN\&. T} .TE .sp 1 .PP If double precision is supported by the device, the following symbolic constant will also be available: .TS allbox tab(:); lB lB. T{ Constant Name T}:T{ Description T} .T& l l. T{ HUGE_VAL T}:T{ .PP A positive double constant expression\&. \fBHUGE_VAL\fR evaluates to +infinity\&. Used as an error value returned by the built\-in math functions\&. T} .TE .sp 1 .PP The following constants are also available\&. They are of type \fBfloat\fR and are accurate within the precision of the \fBfloat\fR type\&. .TS allbox tab(:); lB lB. T{ Constant Name T}:T{ Description T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ M_E_F T}:T{ Value of e T} T{ M_LOG2E_F T}:T{ Value of log2e T} T{ M_LOG10E_F T}:T{ Value of log10e T} T{ M_LN2_F T}:T{ Value of loge2 T} T{ M_LN10_F T}:T{ Value of loge10 T} T{ M_PI_F T}:T{ Value of pi T} T{ M_PI_2_F T}:T{ Value of pi / 2 T} T{ M_PI_4_F T}:T{ Value of pi / 4 T} T{ M_1_PI_F T}:T{ Value of 1 / pi T} T{ M_2_PI_F T}:T{ Value of 2 / pi T} T{ M_2_SQRTPI_F T}:T{ Value of 2 / (square root of pi) T} T{ M_SQRT2_F T}:T{ Value of square root of 2 T} T{ M_SQRT1_2_F T}:T{ Value of 1 / (square root of 2) T} .TE .sp 1 .PP If double precision is supported by the device, the following macros and constants are also available\&. They are of type \fBdouble\fR and are accurate within the precision of the \fBdouble\fR type\&. .TS allbox tab(:); lB lB. T{ Constant Name T}:T{ Description T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ M_E T}:T{ Value of e T} T{ M_LOG2E T}:T{ Value of log2e T} T{ M_LOG10E T}:T{ Value of log10e T} T{ M_LN2 T}:T{ Value of loge2 T} T{ M_LN10 T}:T{ Value of loge10 T} T{ M_PI T}:T{ Value of pi T} T{ M_PI_2 T}:T{ Value of pi / 2 T} T{ M_PI_4 T}:T{ Value of pi / 4 T} T{ M_1_PI T}:T{ Value of 1 / pi T} T{ M_2_PI T}:T{ Value of 2 / pi T} T{ M_2_SQRTPI T}:T{ Value of 2 / (square root of pi) T} T{ M_SQRT2 T}:T{ Value of square root of 2 T} T{ M_SQRT1_2 T}:T{ Value of 1 / (square root of 2) T} .TE .sp 1 .PP The following constants are also available\&. They are of type \fBhalf\fR and are accurate within the precision of the \fBhalf\fR type\&. An application that wants to use \fBhalf\fR and \fBhalf\fR\fB\fIn\fR\fR types will need to include the #pragma OPENCL EXTENSION \fBcl_khr_fp16\fR(3clc) : enable directive\&. .TS allbox tab(:); lB lB. T{ Constant T}:T{ Description T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ M_E_H T}:T{ Value of e T} T{ M_LOG2E_H T}:T{ Value of log2e T} T{ M_LOG10E_H T}:T{ Value of log10e T} T{ M_LN2_H T}:T{ Value of loge2 T} T{ M_LN10_H T}:T{ Value of loge10 T} T{ M_PI_H T}:T{ Value of pi T} T{ M_PI_2_H T}:T{ Value of pi / 2 T} T{ M_PI_4_H T}:T{ Value of pi / 4 T} T{ M_1_PI_H T}:T{ Value of 1 / pi T} T{ M_2_PI_H T}:T{ Value of 2 / pi T} T{ M_2_SQRTPI_H T}:T{ Value of 2 / (square root of pi) T} T{ M_SQRT2_H T}:T{ Value of square root of 2 T} T{ M_SQRT1_2_H T}:T{ Value of 1 / (square root of 2) T} .TE .sp 1 .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBmathFunctions\fR(3clc), \fBFP_CONTRACT\fR(3clc), \fBmacroLimits\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br 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. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 251, section 6.12.2 - Table at end of Math Functions .RE