When I run the following Visual Basic code:
Dim b As Double b = (2 ^ 16 - 1) * Math.Sqrt(Math.Sqrt((a / (2 ^ 8 - 1))))
(Assuming a is double whose value is 15.0)
The result for b is about 32,275.
But when I run the following Java code, which should do the same as above:
double b; b = (2 ^ 16 - 1) * Math.sqrt(Math.sqrt((a / (2 ^ 8 - 1))));
Again with a equal to 15, I get a completely different result: about 17.
Both solutions to this equation:

Why is this so? What I'm working for, Visual Basic gives the result I'm looking for.
Kenan
source share