Wednesday, 15 February 2017

Math : NextDownUpMethod



public class NextDownUpMethod {

    public static void main(String[] args) {

        // get two double numbers        double y = 154.28764;

        // print the next number for y towards x        System.out.println("Math.nextDown(y)="                + Math.nextDown(y));
        // print the next number for x towards y        System.out.println("Math.nextUp(y))="                + Math.nextUp(y));    }
}

No comments:

Post a Comment