Run ❯
Get your
own Java
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
public class Main { public static void main(String[] args) { System.out.println(Math.nextAfter(1, 2)); System.out.println(Math.nextAfter(1, 0)); System.out.println(Math.nextAfter(0.5f, 1.0f)); System.out.println(Math.nextAfter(0.5f, 0.0f)); } }
1.0000001
0.99999994
0.50000006
0.49999997