Java tutorial
public class Main { public static void main(String[] args) { double x = 123.456; double y = 123.1; // print the ulp of these doubles System.out.println("Math.ulp(" + x + ")=" + Math.ulp(x)); System.out.println("Math.ulp(" + y + ")=" + Math.ulp(y)); } }