2

我正在尝试编写此程序以返回非规范值,但出现如下所示的错误。谁能帮我解决这个错误:

support.c: In function 'is_denormal':
support.c:50:34: error: expected expression before ')' token

在这段代码中:

#include <stdio.h>
#include <stdlib.h>
int is_denormal( double x)
{

   union dp_item N1;   
   N1.drep = x;

   union dp_item N2;
   N2.drep = x;



   N1.irep = absolute(N1.drep, x*);
   N1.irep = N1.irep >> 52;
   if (N1.irep == 0x0ULL)
   {

      N2.irep = N2.irep << 12;
      if (N2.irep != 0x0ULL)
      {return 1;}
      return 0;

   }
   else {return 0;}


}

这是绝对函数:

double absolute( double x, double y* )
{
   union dp_item N;   
   N.drep = x;

   N.irep = N.irep & 0x7FFFFFFFFFFFFFFFULL;
   return N.drep;
}

谢谢

4

2 回答 2

9

这一行:

N1.irep = absolute(N1.drep, x*);

语法无效。那是*为了什么?

于 2013-11-12T04:59:56.463 回答
0

在您的代码中:

N1.irep = absolute(N1.drep, x*);

如果您正在考虑x*作为指针 x 那么您错了,您必须将其写为 prefix *x

于 2013-11-12T08:47:45.450 回答