相关疑难解决方法(0)

我的fma()坏了吗?

在使用中,double fma(double x, double y, double z);我希望d下面标有的输出行中有一个非零值'?'.它似乎在内部只使用long double精度,而不是无限精度的规定.

fma函数计算(x× y)+ z,四舍五入一个三元操作:它们计算的值(仿佛)到无限精度和圆一次的结果的格式,根据当前的舍入模式.§7.12.13.12(我的重点)

那我的fma()坏了,或者我在代码或编译选项中如何错误地使用它?

#include <float.h>
#include <math.h>
#include <stdio.h>

int main(void) {
  // Invoking: Cygwin C Compiler
  // gcc -std=c11 -O0 -g3 -pedantic -Wall -Wextra -Wconversion -c -fmessage-length=0 
  //   -v -MMD -MP -MF"x.d" -MT"x.o" -o "x.o" "../x.c"

  printf("FLT_EVAL_METHOD %d\n", FLT_EVAL_METHOD);
  for (unsigned i = 20; i < 55; i++) …
Run Code Online (Sandbox Code Playgroud)

c floating-point gcc5

9
推荐指数
1
解决办法
330
查看次数

标签 统计

c ×1

floating-point ×1

gcc5 ×1