Avoid undefined behavior by performing the negation on an unsigned number in writeLongLong: