Basic routines for exact decimal arithmetic