Sharpness, Smite, Bane of Arthropods, and Impaling appear to subtract damage instead of adding it. If the value that it would normally be increased by is greater than the held item's damage, then it completely prevents damage, but still plays the animation and deals knockback.
Duplicate of MC-271402.