Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strictfp

 
Salim Mohamed
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is strictfp ? In what way is it related to float and double expressions ?
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- strictfp is a modifier that can be applied to a class or a method, and as far as the exam is concerned:
* If marking a method, it forces the method to be strictfp-compliant, which means it adheres to the IEEE 754 standard for floating point numbers, as opposed to using whatever precision the underlying platform can support (which could be *greater* but is always at least guaranteed by the Java spec to be IEEE 754 compliant).
* If marking a class, it means that all methods in that class are strictfp.
And then, of course, you also have to know the details of the IEEE 754 specification. But it is not that bad, really!
OK, just kidding about the spec -- you do NOT have to know anything more than what the strictfp modifier is for, and where it can be used (e.g. on a class or method, but not a variable, etc.)
Cheers,
Kathy
 
Salim Mohamed
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ...
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Salim, compile constant expressions (JLS 15.28) are also implicitly strictfp.
[ November 01, 2002: Message edited by: Jose Botella ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic