Protons, neutrons, nuclei, and other composite baryonic particles have magnetic moments arising from their spin (both the spin and magnetic moment may be zero, in which case the g -factor is undefined). Conventionally, the associated g -factors are defined using the nuclear magneton, and thus implicitly using the proton's mass rather than the particle's mass as for a Dirac particle. The formula used under this convention is μ μ = g μ μ N ℏ ℏ I = g e 2 m p I , where μ is the magnetic moment of the nucleon or nucleus resulting from its spin, g is the effective g -factor, I is its spin angular momentum, μ N is the nuclear magneton, e is the elementary charge, and m p is the proton rest mass.