• 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

What is ur idea of STRICTFP?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all, just wondering what is strictfp.... thanks
Cyrus
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java technically uses the IEEE 754 floating-point math specification. This is a very detailed spec which dictates the precise results of every possible mathematical computation, down to the individual bits. To get the correct, exact, results, you have to compute with 32 bit floats and 64 bit doubles.
Intel processors have extended-precision, 80-bit floating point registers. If the JVM uses these registers for computation, the results will be fast but won't exactly match the IEEE 754 specification. Most JVMs use them as 80-bit registers -- indeed, virtually all software uses them this way. As a result, the numeric results from a Java program might not be exactly portable (note that we're generally talking about differences in the 7th decimal place for floats, or 13th for doubles.)
"strictfp" says that the JVM should follow the specification precisely, even if it's slower and/or "less accurate."
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic