Posts

Showing posts with the label floating-point java

Java Keywords (Part XX): The strictfp Keyword

Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const * float native super while Keyword marked with an asterisk (*) are keywords that, although valid, are not used by programmers. This is going to be an easy one. As of Java 17, this keyword is obsolete. Prior to Java 17, this keyword was used to establish a strict floating-point (strict fp) policy. This meant that, when in use, this keyword guaranteed that floating point calculations would yield the same result across all hardware. When not in use, the Operating System had some leeway in refining precision of floating-point calculations. The keyword would be applied at