A library for exact calculations with rational numbers