Doubling the last letter

Hello everybody,
I need to know when to double the last letter in a word, and when it’s not permitted. Thanks.

.
Basically, the final consonant is doubled before -ing and -ed when it is required to maintain the ‘short’ pronunciation of the preceding vowel sound.:

Forget - forgetting
bat - batted

Words with ‘silent’ final -e do not double the remaining consonant when the -e is dropped; this is to maintain the ‘long’ sound of the preceding vowel:

Bite - biting
fate - fated

.