It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Strictfp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Strictfp" Watch "Strictfp" New topic


Salim Mohamed
Ranch Hand

Joined: Sep 19, 2002
Posts: 55
What is strictfp ? In what way is it related to float and double expressions ?
Kathy Sierra
Cowgirl and Author

Joined: Oct 10, 2002
Posts: 1589
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.)

Co-Author of Head First Design Patterns
Just a Jini girl living in a J2EE world.
Salim Mohamed
Ranch Hand

Joined: Sep 19, 2002
Posts: 55
Thank you ...
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Salim, compile constant expressions (JLS 15.28) are also implicitly strictfp.
[ November 01, 2002: Message edited by: Jose Botella ]

SCJP2. Please Indent your code using UBB Code
I agree. Here's the link:
subject: Strictfp
It's not a secret anymore!