[英]Where in the C++11 standard is std::fmodf stated?
According to the cppref page , std::fmodf was added to cmath in C++11.根据cppref 页面,在 C++11 中将 std::fmodf 添加到 cmath。 How is this possible though, because wouldn't this mean that cmath would break compatability with math.h previous to C++11?
这怎么可能,因为这不意味着 cmath 会破坏与之前 C++11 之前的 math.h 的兼容性吗? I'm unable to find any references that say std::fmodf was added in C++11 and was wondering where this is stated.
我找不到任何说 std::fmodf 被添加到 C++11 的引用,我想知道这是在哪里说明的。
Thank you谢谢
Where in the C++11 standard is std::fmodf stated?
在 C++11 标准中的什么地方规定了 std::fmodf?
It wasn't mentioned directly (although it probably should have been mentioned either in the list of functions, or explicitly omitted).它没有直接提及(尽管它可能应该在函数列表中提及,或者明确省略)。 The change that causes
std::fmodf
to exist is here (quote from draft N3337):导致
std::fmodf
存在的变化在这里(引自草案 N3337):
The following referenced documents are indispensable for the application of this document.
以下参考文件对于本文件的应用是必不可少的。 For dated references, only the edition cited applies.
对于注明日期的参考文献,仅引用的版本适用。 For undated references, the latest edition of the referenced document (including any amendments) applies.
对于未注明日期的引用文件,引用文件的最新版本(包括任何修改)适用。
- ...
...
- ISO/IEC 9899: 1999 , Programming languages — C
ISO/IEC 9899: 1999 ,编程语言 — C
- ...
...
Through the following rule:通过以下规则:
[c.math]
[c.数学]
The contents of these headers are the same as the Standard C library headers <math.h> and <stdlib.h> respectively, with the following changes: ...
这些头文件的内容分别与标准 C 库头文件 <math.h> 和 <stdlib.h> 相同,具有以下更改: ...
C99 added fmodf. C99 添加了 fmodf。 It was inherited to C++ when C++11 started referring to the standard library of C99 instead of C89.
当 C++11 开始引用 C99 的标准库而不是 C89 时,它被继承到 C++。
Note, the "following changes" do not list omission of fmodf
.请注意,“以下更改”并未列出
fmodf
的遗漏。
Why isn't fmodf listed in the list of functions (26.8/3 and 26.8/9)?
为什么 fmodf 没有在函数列表(26.8/3 和 26.8/9)中列出? It was added to the list in the C++17 standard.
它被添加到 C++17 标准的列表中。
This appears to have been an editorial mistake.这似乎是一个编辑错误。 It seems to have been fixed in C++17 by P0175 which proposes:
它似乎已由P0175在 C++17 中修复,它建议:
In this editorial paper we propose to add to the working draft the complete synopses of the C library headers that are included in C++ by reference to the C standard (see Table 15).
在这篇社论论文中,我们建议通过参考 C 标准,将 C 库头文件的完整概要添加到工作草案中,这些头文件包含在 C++ 中(见表 143E1257Z 标准) These synopses will replace the various tables captioned “Header synopsis”.
这些概要将取代标题为“标题概要”的各种表格。
Sidenote: std::fmodf
is fairly useless in C++, since you can simply use std::fmod
instead, and that has been around since C++98.旁注:
std::fmodf
在 C++ 中相当无用,因为您可以简单地使用std::fmod
来代替,而且自 C++98 以来一直存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.