Make libm tests more portable