The nextafter() purpose computes the closest representable quantity into a presented number; it can be used to point out just how exact a supplied variety is. What you have is an example of system overloading. The good aspect is that the compiler as well as the JVM will decide on the right system immediately according to the kind of the argument