Compute the following mathematical functions.
Math.round(3.2)
Math.round(3.6)
Math.floor(3.2)
Math.floor(3.6)
Math.ceil(3.2)
Math.ceil(3.6)
Math.round(3.2)
Math.round(3.6)
Math.floor(3.2)
Math.floor(3.6)
Math.ceil(3.2)
Math.ceil(3.6)
----
public class LabMath {
/**
* @param args
*/
public static void main(String args[]) {
System.out.println("Math.round(3.2) = " + Math.round(3.2) );
System.out.println("Math.round(3.6) = " + Math.round(3.6) );
System.out.println("Math.floor(3.2) = " + Math.floor(3.2) );
System.out.println("Math.floor(3.6) = " + Math.floor(3.6) );
System.out.println("Math.ceil(3.2) = " + Math.ceil(3.2) );
System.out.println("Math.ceil(3.2) = " + Math.ceil(3.6) );
// TODO 自動產生方法 Stub
}
}
沒有留言:
張貼留言