Strictfp

Strictfp

strictfp is a Java keyword used to restrict floating-point calculations to ensure portability. The modifier was introduced into the Java programming language with the Java virtual machine version 1.2.

In older JVMs, floating-point calculations were always strict floating-point, meaning all values used during floating-point calculations are made in the IEEE-standard "float" or "double" sizes. This could sometimes result in a numeric overflow or underflow in the middle of a calculation, even if the end result would be a valid number. Since version 1.2 of the JVM, floating-point calculations do not require that all numbers used in computations are themselves limited to the standard "float" or "double" precision.

However, for some applications, a programmer might require every platform to have precisely the same floating-point behavior, even if some platforms could handle more precision. In that case, the programmer can use the modifier strictfp to ensure that calculations are performed as in the earlier versions—only with "float"s and "double"s.

The modifier can be used in combination with classes, interfaces and methods.

Compile-time constant expressions must always use strict floating-point behavior. Other expressions use strict floating-point math if they are contained in a method, interface, or class which uses the strictfp modifier in its declaration. In a class declaration, the modifier can be placed like this:public strictfp class MyFPclass { // ... contents of class here ...}

References

* http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#24465


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Strictfp — Este artículo o sección necesita referencias que aparezcan en una publicación acreditada, como revistas especializadas, monografías, prensa diaria o páginas de Internet fidedignas. Puedes añadirlas así o avisar …   Wikipedia Español

  • Comparison of C Sharp and Java — The correct title of this article is Comparison of C# and Java. The substitution or omission of the # sign is because of technical restrictions. Programming language comparisons General comparison Basic syntax Basic instructions …   Wikipedia

  • Java syntax — The syntax of the Java programming language is a set of rules that defines how a Java program is written and interpreted. Data structuresAlthough the language has special syntax for them, arrays and strings are not primitive types: they are… …   Wikipedia

  • Java (informatique) — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

  • Java (langage) — Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript. Java …   Wikipédia en Français

  • Java (langage de programmation) — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

  • Java 5 — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

  • Langage Java — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

  • Langage de programmation Java — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

  • Oak (langage) — Java (langage) Pour les articles homonymes, voir Java.  Ne doit pas être confondu avec JavaScript …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”