Yes, the behavior of functions is normally intended.

You can not emulate atan2 with fatan - you need indeed a function similar to what you've posted. There is no C-Script equivalent of atan2.