Support the bcmath.scale INI setting
Correct return types so that null is actually returned in error cases