At least 1 of the variables i or n needs to be of datatype float
for the operator /
to evaluate its operands as a float
value.
Alternatively you can temporarily upcast 1 of the variables to float
:
float k = kMax * sqrt( (float) i / n );
At least 1 of the variables i or n needs to be of datatype float
for the operator /
to evaluate its operands as a float
value.
Alternatively you can temporarily upcast 1 of the variables to float
:
float k = kMax * sqrt( (float) i / n );