added a utility function to get the integer rounded gain