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.

内联函数的使用



您好~打算用内联函数写一个函数,但是每次用_amem4读一个浮点型的数时,读出来的值都是不对的,只能用_amemd8读64位(两个浮点型的数)!请问,这是什么原因??谢谢~

  • 你好,

    在手册中找到_amem4的定义如下:

    该函数的返回值是unsigned类型,而不是float型。

    _amem8的定义如下

    该函数的返回值是double类型。

    综上两点就能解释你的疑问“_amem4读一个浮点型的数时,读出来的值都是不对的,只能用_amemd8读64位(两个浮点型的数”

    请你确认下这解释是否正确,若有疑问,请继续跟贴,谢谢!

  • 嗯 好的 谢谢!那好像手册里并没有读一个float型数据的内联函数啊!