This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IQmath问题

a的值是浮点数2.5转化成的IQ值是对的,但是b的值应该为2.5,调试的时候b一直显示的是0,为什么IQ值不能反过来转化为浮点类型的呢?

完整代码如下:

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/interrupt.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/fpu.h"
#include "uart_fun.h"
#define MATH_TYPE IQ_MATH
#define GLOBAL_Q 8
#include "IQmath/IQmathLib.h"
#define PI 3.14159
#define sine_size 100
_iq sincode[sine_size]={_IQ(0.1)};
void UARTIntHandler(void)
{}
void SysTickHandler(void)
{}
int main(void)
{
int8_t i;
uint32_t sysclk;
_iq a;
long b;
FPUEnable();
FPULazyStackingEnable();
SysCtlClockSet(SYSCTL_XTAL_16MHZ|SYSCTL_OSC_INT|SYSCTL_USE_PLL|SYSCTL_SYSDIV_2_5);//ϵͳʱÖÓ80Mhz
sysclk=SysCtlClockGet();
a=_IQ(2.5);
b=_IQtoF(a);
}
}

x 出现错误。请重试或与管理员联系。