Code/코딩 끄적
strictfp (Strict Floating Point)
코-빗
2024. 3. 3. 22:43
728x90
JVM이 부동소수점 연산에 엄격하지 않기 때문에
Strict Floating Point (엄격한 부동소수점) 정책을 적용하여
일관성을 보장하도록 강제할 수 있다.
strictfp는 클래스, 인터페이스, 비추상 메소드에 사용될 수 있다.
strictfp interface Fooable {}
public strictfp class Foo {}
public class Test {
public strictfp void echo() {}
}
오버플로우, 언더플로우가 없는 경우 strictfp 사용 따른 결과의 차이는 없다.
728x90