开发者

Xcode Using Exponents

开发者 https://www.devze.com 2023-03-05 14:40 出处:网络
This is probabl开发者_如何学Goy a simple question, but I a variable \"side\" to be divided by the square of the variable \"curNum\". Currently, my code for this looks like

This is probabl开发者_如何学Goy a simple question, but I a variable "side" to be divided by the square of the variable "curNum". Currently, my code for this looks like

side = inputNum/(curNum^2);

However, this gives me the error "Invalid operands to binary ^" How can I successfully use exponents?


Try

pow(curNum, 2) 

Should work......

0

精彩评论

暂无评论...
验证码 换一张
取 消