Is the result of sqrtf exact when value is actually squared?

80 Views Asked by At

I wanted to know if the result of std::sqrtf is exact if the value is actually squared.

int value = ...;
int root = (int)sqrtf((float)value); // is this safe?

Note that value is integer and not always squared. in that case I want to truncate the result.

0

There are 0 best solutions below