Having issues with the sqrt function in two languages.
I have a JAVA API and C++ client, I'm trying to use the sqrt
functions in both but they give me slightly different numbers.
The inputs are:
x = 25.0
y = 5625.0
Java:
double distance = Math.sqrt(x + y);
// outputs 75.16648189186454
C++:
const double distance = std::sqrt(x + y);
// outputs 75.166481891864535
I need the numbers to be the same as I'm using them as seeds in the API and client. Is there any way to do this? Ideally the java
output 75.16648189186454
, however, I will take either.
Many thanks