Basic routines for exact decimal arithmetic (ref. IEEE 754-2008)