How can I obtain the cube root in C++?

后端 未结 8 1938
你的背包
你的背包 2020-12-09 02:12

I know how to obtain the square root of a number using the sqrt function.

How can I obtain the cube root of a number?

8条回答
  •  囚心锁ツ
    2020-12-09 02:50

    The nth root of x is equal to x^(1/n), so use std::pow. But I don't see what this has to with operator overloading.

提交回复
热议问题