Note that methods such as Math.sqrt specify a correctly rounded result --- all conforming Java implementations must return exactly the same result for this method.While doing your own thing in integers may ensure that all clients produce the same answer, it also increases the likelihood that the answer obtained is wrong!