Power
Power comes from the weapon's level (L below), not your character level. It's built from the game's LevelAndTierCurve, and the rule changes at levels 26, 30 and 31:
Levels 1–25
Power = ceil(10 × 1.125(L − 1))
Each level multiplies the curve by 1.125, then the result is rounded up to a whole number. For example, level 12: ceil(10 × 1.12511) = ceil(36.53) = 37.
Levels 26–29
Power = ceil(10 × 1.25(L − 25) × 1.125(L − 1))
An extra × 1.25 is stacked on for every level past 25, which is why power jumps from 169 at level 25 to 238 at level 26. Still rounded up.
Level 30
Power = 930
With the removal of the World Tier system, level 30 was set to a fixed value of 930. The curve on its own would give 929.
Levels 31–40
Power = round(3358 ÷ 1.125(40 − L))
Works back from 3358 at level 40, dividing by 1.125 for each level below it. Only the final value is rounded, to the nearest whole number.
Power at every level
Curve
A multiplier from the WeaponDamage curve in the game's attribute curve file. Each bracket stores two values, A and B, and the curve works out as Power × A² + Power × B, which is the same as multiplying power by A² + B.
The bracket is picked by power, not level:
From level 12 up, A is 0 and the curve is a flat 0.1. That's why level 40 High-End damage is just myDamageMax × 470.12 (3358 × 0.1 × 1.4).
Pellets & rounding
myBulletsPerRound from the weapon file: 8 for shotguns, 2 for The Ravenous, and 1 for almost everything else.
The game works out damage per pellet, drops the decimals with floor, and then multiplies by the pellet count. For example:
Rock n' Roll (ACS-12), level 40, High-End
48.06 × 3358 × 0.1 × 1.4 = 22,593.97 per pellet
floor(22,593.97) = 22,593
22,593 × 8 = 180,744
Multiplying by 8 first and flooring after would give 180,751 instead, so the order matters for any weapon that fires more than one pellet per shot.
Additive damage bonuses follow the same order. Weapon damage, weapon type damage (AR, SMG...), specialization bonuses, event buffs and talents that add weapon damage are all summed into one percentage and applied to each pellet before the floor and the pellet multiplication:
floor(per pellet × (1 + total bonus %)) × Pellets
For example, a level 31 High-End Rock n' Roll is 7,825.13 per pellet. With +9.9% weapon damage: floor(7,825.13 × 1.099) = 8,599, × 8 = 68,792, which matches the game.
Amplifiers are separate. Not every talent is additive. Anything that amplifies damage, e.g. Glass Cannon, isn't added into the bonus percentage. Each amplifier multiplies the final figure on its own, after everything above:
Final = damage with bonuses × (1 + amp 1) × (1 + amp 2) × ...
So two 20% amplifiers give × 1.44, not × 1.4, and they're worth far more than the same amount of additive weapon damage.