This is IEEE 754 standard question. I don't completely understand the mechanics behind it.
public class Gray { public static void main(String[] args){ ...