How would I compare the square of the square root of any number.

How would I compare the square of the square root of any number. The difference in these values is due to the rounding error in Java.

Example: Enter number 2

The answer I should get is: 2.000000000000004

Round off error: -4.440892

The answers are estimated answers but are very close

Re: How would I compare the square of the square root of any number.

Quote:

How would I compare

Use the standard operators to compare primitives: ==, !=, <, <= etc