REMQUO(3clc)
β¨ REMQUO(3clc) β¨
okay bestie, welcome to remquo from the OpenCL Manual π this one's a floating point remainder and quotient function, and yes it's giving "two jobs, one icon" energy π
πΈ NAME πΈ
remquo β floating point remainder and quotient function. that's the whole vibe. π
here's the full cast of characters, like literally every single prototype, no skips, no cap:
floatn remquo(floatn x, floatn y, __global intn *quo);
floatn remquo(floatn x, floatn y, __local intn *quo);
floatn remquo(floatn x, floatn y, __private intn *quo);
float remquo(float x, float y, __global int *quo);
float remquo(float x, float y, __local int *quo);
float remquo(float x, float y, __private int *quo);
doublen remquo(doublen x, doublen y, __global intn *quo);
doublen remquo(doublen x, doublen y, __local intn *quo);
doublen remquo(doublen x, doublen y, __private intn *quo);
double remquo(double x, double y, __global int *quo);
double remquo(double x, double y, __local int *quo);
double remquo(double x, double y, __private int *quo);
halfn remquo(halfn x, halfn y, __global intn *quo);
halfn remquo(halfn x, halfn y, __local intn *quo);
halfn remquo(halfn x, halfn y, __private intn *quo);
half remquo(half x, half y, __global int *quo);
half remquo(half x, half y, __local int *quo);
half remquo(half x, half y, __private int *quo);
look at that list. eighteen whole prototypes. she ate and left no crumbs π
π« DESCRIPTION π«
so remquo computes the value r such that r = x - n*y, where k is the integer nearest the exact value of x/y. yes bestie, the manpage really does say k there, and we are respecting the text exactly π
if there are two integers closest to x/y, then k shall be the even one. cute, right? ties go to the even one, very fair, very demure β¨
if r is zero, it gets the same sign as x. and just so you know β this is literally the same value that gets returned by the remainder(3clc) function. same energy, different function name π«Ά
BUT WAIT there's more, because remquo is a multi-talented main character π it also calculates the lower seven bits of the integral quotient x/y, and gives that value the same sign as x/y. then it stores this signed value in the object pointed to by quo. slay π
π¦ NOTES π¦
- the vector versions of the math functions operate component-wise. the description is per-component, so like, imagine it happening in every lane simultaneously. parallel queen β¨
- 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. consistent, unbothered, moisturized πΈ
- the built-in math functions take scalar or vector arguments. for any specific use of these functions, the actual type has to be the same for all arguments and the return type, unless otherwise specified. no mixing, bestie, that's the rule π
- 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), the generic type namegentypemay indicatehalfandhalf{2|3|4|8|16}as arguments and return values. yes, half gets to come too, inclusivity icon π - 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] β
π§ SEE ALSO π§
go read that one next bestie, it's the whole friend group π«Ά
π 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.
ngl the license text stays exactly as-is, because legal text is the one thing we do NOT remix π
π NOTES π
- OpenCL Specification β page 244, section 6.12.2 - Math Functions
and that's the whole page, bestie!! π
this was The Khronos Group, dated 01/14/2021, and the page is literally called REMQUO(3clc) β you're so welcome, go forth and compute remainders and quotients responsibly πΈβ¨π¦π
π¦ 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