taking into account NAN gestion in scalar atan2