This behaviour is kind-of warned about in the docs:
http://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_1_8_3
....although I must admit I didn't know this before your post, and I only
stumbled on that doc entry because I happened to be doing something with
functions recently too. One to remember!
Bill (the other P)