LDEXP(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

okay so bestie, this is ldexp from the OpenCL Manual β€” and what it does is literally multiply x by 2 to the power k. that's it. that's the whole vibe. exponent queen behavior πŸ‘‘

here's every single signature, character for character, no edits, no notes:

floatn ldexp(floatn x, intn k);

floatn ldexp(floatn x, int k);

float ldexp(float x, int k);

doublen ldexp(doublen x, intn k);

doublen ldexp(doublen x, int k);

double ldexp(double x, int n);

halfn ldexp(halfn x, intn k);

halfn ldexp(halfn x, int k);

half ldexp(half x, int k);

✨ DESCRIPTION ✨

Multiply x by 2 to the power k. πŸ’… that's the function. it's giving "just a lil scaling by a power of two" and honestly? iconic.


πŸŽ€ NOTES πŸŽ€

okay so the tea, and you need this tea:

  • the vector versions of the math functions operate component-wise. the description is per-component. so like, each lil lane does its own thing, no cross-talk, no drama πŸ¦‹
  • 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. so whatever chaos the surrounding environment is on, these stay unbothered. main character energy fr fr
  • the built-in math functions take scalar or vector arguments. the generic type name gentype is used to indicate that the function can take float, float2, float3, float4, float8, or float16 as the type for the arguments. for any specific use of these function, the actual type has to be the same for all arguments and the return type β€” no mixing, bestie, it's a matching set or nothing 😀
  • if extended with cl_khr_fp16(3clc), generic type name gentype may indicate half and half{2|3|4|8|16} as arguments and return values. ✨

🌈 SPECIFICATION 🌈

OpenCL Specification[1]


🫢 SEE ALSO 🫢


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group


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 244, section 6.12.2 - Math Functions

and that's the whole page bestie, no cap πŸ’œ shoutout to The Khronos Group for writing it and for the 01/14/2021 date stamp β€” go forth and scale by powers of two, you absolute icon, ily, bye 🧚🌸

πŸ“¦ where this page comes from