Experience/Core series/Experience gain in battle/Apparent Exp. All programing error in Generation I

In Generation I, the behavior of Exp. All seems to be coded wrong. Presumably, Exp. All is intended to apportion half of the total battle experience for distribution among the Pokémon that battled and half for distribution among the party members. However, the portion distributed among party members is instead equal to the experience that one battling Pokémon received.

This works correctly if only one Pokémon battles while the Exp. All is in the player's bag. For example, if one Pokémon out of a party of five battles, then the battler will get 50% of the experience and all five party members will also split 50%, each getting 10% of the total experience, adding up to 100%.

However, some battle experience will be lost if multiple Pokémon are sent into one battle. For example, if two Pokémon out of a party of five battle, then the battlers will each get 25% of the experience. All five party members will then also split 25%, each getting 5% of the experience, adding up to only 75%, with the remaining 25% of the experience lost.