-g switch displays the amount of memory in gigabytes (GiB), but rounded down. I notice you are displaying the totals, so unlike most of the other output of the
free command, these are the sum of RAM that is (a) in use; (b) holding page cache; or (c) not in use at all.
The "totals" you are seeing are the amount of usable memory on the sticks. Memory is advertised at even powers of two, but almost never has every last byte as advertised.
Also, system memory that is reserved for hardware devices, such as an integrated graphics chip with a unified memory architecture, might be subtracted from this total.