gpt4 book ai didi

c++ - _nextafterf 在 Visual C++ 上

转载 作者:搜寻专家 更新时间:2023-10-31 01:19:36 24 4
gpt4 key购买 nike

我需要在 Visual C++ 32 位上使用函数 _nextafterf 来计算一些结果与引用函数在 ULP 中的距离。

C99 为 float 和 double 提供了 nextafterf 和 nextafter,但 Visual C++ 不支持这些函数。但是,Visual C++ 2010 支持 _nextafterf 和 nextafter from 但仅支持 64 位...对于 32 位模型,仅支持 _nextafter 和 from ...

有没有一种方法可以让 _nextafterf 在 Visual Studio 上工作,最高可达 Visual C++ 2005?

谢谢,克里斯托夫

最佳答案

在 Boost.Math 中有一个模板化的等效 nextafter,参见 Finding the Next Representable Value in a Specific Direction (nextafter) .

The C99 functions must use suffixes f and l to distinguish float and long double versions. C++ uses the template mechanism instead.

关于c++ - _nextafterf 在 Visual C++ 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5897874/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com