我们几乎都知道strictfp是如何工作的。
像这样的东西:
package com.hk.basicjava.tests.strictfp;
import java.util.*;
public class StrictFP {
public static void main(String[] argv) {
double d = Double.MIN_VALUE;
System.out.println("non strictfp : " + notStrictFP(d)); // may be 4.9E-324
System.out.println("strictfp : " + strictFP(d)); // should be 0
}
static double notStrictFP(double a) {
return (a / 2 ) * 2;
}
static strictfp double strictFP(double a) {
return (a / 2 ) * 2 ;
}
}
但是,是否有人知道特定的硬件/操作系统(可能还有 JRE)组合,其中有和没有strictfp说明符的方法返回的结果存在差异?
我尝试了几种组合,但没有任何区别。