Well, it's just binary logic.
You just have to know what you want.
Here for example if you want to know if someone has the permission to add an attachment, you would use this.
PHP Code:
if ($forumperms & CANPOSTATTACHMENT)
if you want to know if a user has every permission EXCEPT adding attachments, you would use ~ before.
and so on.
You just have to use it a few times, and then you will get into it