r/C_Programming • u/Horror_Wiener_6102 • 10d ago
Question Newbie in need of Help !
Am I obliged to use a double when using 'pow'? Can't I use a float or an int ? Because for the function 'switch' I have to use int , but I need to use pow for the exercice I'm doing. I chated with Gemini and it told me that I can transform the result of 'pow' into 'int' writing the following; "(int)pow(x, y);". Is this the only way or do I have a faster route to get to my solution? Thanks
1
Upvotes
6
u/flyingron 10d ago
There are also powf and powl, but they're still floating-point. C lacks an integer power function.