Calculates the molar mass of a chemical compound.