0
To find root of a no. Using power function !
why we use pow(base, 1.0/order)? i used pow (base, 1/order) but the output every time was 1. so why that .0 thing matters??
3 odpowiedzi
+ 2
1/order is rounded to 0 since the result must be an int
+ 2
1/order is rounded to 0 if order is an integer, because division of integers is defined this way in the c++ standard.
x^0=1 for all x not equal to 0.
1.0/order is rounded to the next floating point number. since x^(1/n) is the nth squareroot of x we get approximately the nth squareroot x
0
please be more precise