你应该可以打电话Matchers.closeTo(double, double).使用静态导入,它看起来像:
Matchers.closeTo(double, double)
assertThat(result, closeTo(0.5, 0.1));