NAN(3clc)
β¨ NAN(3clc) β the OpenCL Manual's lil' NaN factory β¨
okay bestie, welcome to NAN, straight outta the OpenCL Manual π this is the page about making yourself a quiet NaN, and honestly? it's giving "short but iconic."
π NAME π
nan β Quiet NaN. that's it. that's the whole vibe. a quiet queen. π€«π
πΈ SYNOPSIS πΈ
floatn nan(uintn nancode);
float nan(uintn nancode);
doublen nan(ulongn nancode);
double nan(ulong nancode);
halfn nan (ushortn nancode) // if
half extension enabled
like. look at all these overloads. so many flavors of the same energy. β¨
π DESCRIPTION π
nan returns a quiet NaN. and here's the lil detail that slaps: the nancode may be placed in the significand of the resulting NaN. so you can sneak your own lil signature into the NaN itself. it's your NaN, you get to decorate it π
π¦ NOTES π¦
okay this is the part where I gotta be fr fr, because there's a whole pile of ground rules:
- the vector versions of the math functions operate component-wise. the description is per-component. so like, per lil lane, yk?
- the built-in math functions are not affected by the prevailing rounding mode in the calling environment, and they always return the same value as they would if called with the round to nearest even rounding mode. periodt. they don't care what mood your environment is in π
- the built-in math functions take scalar or vector arguments. for any specific use of these function, the actual type has to be the same for all arguments and the return type unless otherwise specified. no mix-and-matching, bestie π
- the generic type name
gentypeis used to indicate that the function can takefloat,float2,float3,float4,float8,float16,double,double2,double3,double4,double8, ordouble16as the type for the arguments. - if extended with
cl_khr_fp16(3clc), generic type namegentypemay indicatehalfandhalf{2|3|4|8|16}as arguments and return values. half girlies rise up π - the generic type name
gentypefis used to indicate that the function can takefloat,float2,float3,float4,float8, orfloat16as the type for the arguments. - the generic type name
gentypedis used to indicate that the function can takedouble,double2,double3,double4,double8, ordouble16as the type for the arguments.
π SPECIFICATION π
OpenCL Specification[1] β yep, that's the whole thing. iconic minimalism. β¨
π SEE ALSO π
mathFunctions(3clc)β go say hi, it's the family reunion π«Ά
π AUTHORS π
The Khronos Group. the founders. the main characters. π§
π 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 following condition:
the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials. yes, ALL of them. no skipping, bestie. π«Ά
π NOTES (the numbered kind) π
- OpenCL Specification β page
244, section6.12.2- Math Functions π
and that's the whole page, bestie!! π sending you off with the official sign-off: this was brought to you by The Khronos Group, dated 01/14/2021, and it lives at NAN(3clc) in the OpenCL Manual. slay, stay quiet, stay NaN πβ¨π¦
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms