In this book
http://eaglescholar.georgiasouthern...._201005_MA.pdf
you'll find a description what Prien did when confronted with a task force of troop transports and a cruiser: one torpedo for each ship. At that point he didn't know that the torpedoes would likely malfunction, though. If he had anticipated failure the decision would likely have been different.
In BdU's war diary
http://www.uboatarchive.net/BDUKTB30261.htm
it reads that the U-boats taking part in the operation for supporting the invasion of Norway were not to attack "secondary targets" like merchant ships or convoys that were not part of Allied counteroperations. However there is no restriction attacking battleships.
I would think that a battleship would always have been a U-boat commander's number one target. Personally I would prefer to sink any of those darn carriers if given the choice between one and a battleship. I hate those airplanes