Menu

#811 std::sqrtf, std::sqrtl not supported

v1.0 (example)
closed-invalid
nobody
None
5
2019-08-09
2019-08-09
Old Wolf 2
No

Sample code:

#include <cmath>
auto x = std::sqrtf(1.0f);

Compilation command: g++ -std=c++17 foo.c

Gives error error: 'sqrtf' is not a member of 'std'

Version: g++.exe (Rev2, Built by MSYS2 project) 8.3.0

It works to use ::sqrtf, and also works to use std::sqrt (which chooses the correct overload). But the C++ Standard section [cmath.syn] requires that including <cmath> makes std::sqrtf available.

The same problem exists for std::sqrtl, std::powf, std::powl, std::ceilf and std::ceill at least. (After spotting the problem with sqrtl I tried a few other functions and saw the same issues -- this is not an exhaustive list).

Discussion

  • Doug Semler

    Doug Semler - 2019-08-09
    • status: open --> closed-invalid
     

Log in to post a comment.