- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
通过阅读 C 规范,我发现了这个函数:
double remquo(double x, double y, int *quo);
float remquof(float x, float y, int *quo);
long double remquol(long double x, long double y,
int *quo);
The
remquo
functions compute the same remainder as theremainder
functions. In the object pointed to by quo they store a value whose sign is the sign ofx/y
and whose magnitude is congruent modulo 2^n to the magnitude of the integral quotient ofx/y
, where n is an implementation-defined integer greater than or equal to 3.The
remquo
functions returnx
REMy
. Ify
is zero, the value stored in the object pointed to byquo
is unspecified and whether a domain error occurs or the functions return zero is implementation defined.
我理解它返回什么,它返回 fmod(x, y)
,但我不理解整个 quo
部分。它在语义上等于这个吗?
*quo = (int) x/y;
*quo %= n; /* n implementation defined */
最后一个问题,这个函数有什么用?
最佳答案
remquo() 的典型用法是减少三角函数参数。商的最后 3 位将允许一个人知道一个角度位于哪个半象限,在减少模 Pi/4 之后,并将原始 trig 调用转换为另一个在 [0,Pi/内的角度的 trig 调用4) 区间(新的触发函数可能不同)。后者通常通过 Pade 近似计算。
关于c - remquo 函数的作用是什么?它有什么用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9349990/
我读了here remquo 应该返回: If successful, returns the floating-point remainder of the division x/y as defi
这个问题在这里已经有了答案: remquo Results Not Making Sense (2 个答案) 关闭 3 年前。 我试图在 C++ 中找出一个 double 分成另一个 double
std::remquo 函数的目的是什么?什么时候使用它而不是常规 std::remainder 函数的示例是什么? 最佳答案 remquo 在出现在 C++ 之前首先出现在 C99 中,以下是 C9
在 C99 规范中它说 remquo: The remquo functions are intended for implementing argument reductions which can
通过阅读 C 规范,我发现了这个函数: double remquo(double x, double y, int *quo); float remquof(float x, float y, int
在一些内部循环中我有: double x; ... int i = x/h_; double xx = x - i*h_; 认为这可能是更好的方法,我尝试使用 std:
我是一名优秀的程序员,十分优秀!