EatTheBlocks Forum

Why output amount calculation of pancakeswap add inputAmountWithFee to denominator

Hello, i have a question about output amount token calculation of pancakeswap. When i given input amount of token A, then calculate output amount of token B. Here is how they did:
inputAmountWithFees = inputAmount * FEES_NUMERATOR;
outputAmount = inputAmountWithFees * outputReserve / (inputReserve * FEES_DENOMINATOR + inputAmountWithFees)
I dont know why inputAmountWithFee added to denominator? Doesn’t that change the fee?