• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Math.IEEEremainder

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There were no questions about this method on my 1.2 exam two weeks ago.
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Dan,
Can you tell me how IEEEremainder works.
Just a bit curious to know
Thanks
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic