Hello Will there be questions on Math.IEEEremainder method in the exam?? Math.IEEEremainder(7,2.5) o/p -0.5 Math.IEEEremainder(-7,2.5) o/p 0.5 Can anyone explain why? Thanks

No, the java.lang.Math.IEEEremainder method will not be on the exam. The exam only covers the following methods from the java.lang.Math class: abs, ceil, floor, max, min, random, round, sin, cos, tan, sqrt. For that reason, I removed the IEEEremainder methods from my mock exam.

Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>

Hey Dan, I hope you are saving all those problems you have removed for your forthcoming book "Questions you wanted to be asked for SCJP, but wern't"! -Barry

Barry, Yes, I still have them. Maybe I should use them for an interview exam next time I'm in a management position. Maybe that would be just a little too cruel.

Chitra Jay
Ranch Hand

Joined: May 02, 2002
Posts: 76

posted

0

Hello Dan, Can you tell me how IEEEremainder works. Just a bit curious to know Thanks

Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865

posted

0

Originally posted by Chitra Jay: Hello Dan, Can you tell me how IEEEremainder works. Just a bit curious to know Thanks

Chitra, The following is a question, answer, and remark from an earlier version of my mock exam. class H { public static void main (String[] args) { double c = Math.IEEEremainder(5,3); System.out.print(c); } } Prints: -1.0 The Math.IEEEremainder method calculates the remainer using the IEEE 754 standard. The basic algorithm is f1 - f2 X n where n is an integer such that the absolute value of f1 - f2 X n is as small as possible. In this case, Java selects 2 for the value of n because the absolute value of 5 - 6 is smaller than the absolute value of 5 - 3.