Type consistency for trailing zeros function