Throw an exception if scaling factor is zero