I never agree on taking exp of probabilities. This might cause underflows. Either make sure (in the Math) that this never happens (for example if you know you have a prior avoiding small probabilities) and explicitly state why underflows will not appear, or check for them. But usually implementations do not need to take exp of probabilities. If you do, also explicitly state why (in a comment). Important to scale things up later on