OGeek|极客世界-中国程序员成长平台

标题: IOS 9, iPhone 6S plus, metal, 无法链接到功能 frexp [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 20:57
标题: IOS 9, iPhone 6S plus, metal, 无法链接到功能 frexp

IOS metal 新手,我正在尝试编写内核。我的函数需要链接到 frexp 函数。不幸的是,我引用 frexp 函数的内核无法编译。

    float exponent = 0.0;
    float mantissa = frexp(value, exponent);

Metal 文档将函数协议(protocol)列为: T frexp(T x, Ti &exp)

我能够编译成其他类似的数学函数,例如 exp、exp2、exp10、ldexp。

有人能链接到 Metal 的 frexp 函数吗?或者知道如何查看 metal_math 包含文件以查看编译器引用的 frexp 协议(protocol)?

谢谢!



Best Answer-推荐答案


在阅读了我自己的问题后,我发现了我的错误,更正后的代码如下所示。

int exponent = 0.0;
float mantissa = frexp(value, exponent);

关于IOS 9, iPhone 6S plus, metal, 无法链接到功能 frexp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38114218/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4