Problem cuberoot
User user123
Submission Time 2023-06-27 20:31:40
Score 0
Max Time N/A
Max Memory N/A

Compile Error

cuberoot.cpp: In function ‘int main()’:
cuberoot.cpp:29:23: error: call of overloaded ‘cbrt(long double&)’ is ambiguous
29 | cout << cbrt(x) << endl;
| ^
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/9/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:528,
from /usr/include/c++/9/iostream:38,
from cuberoot.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:152:1: note: candidate: ‘double cbrt(double)’
152 | __MATHCALL (cbrt,, (_Mdouble_ __x));
| ^~~~~~~~~~
cuberoot.cpp:5:13: note: candidate: ‘long double cbrt(long double)’
5 | long double cbrt(long double x) {
| ^~~~
In file included from cuberoot.cpp:2:
/usr/include/c++/9/cmath:1272:3: note: candidate: ‘constexpr long double std::cbrt(long double)’
1272 | cbrt