math: support platforms with limited FP rounding or exception support