You could use an infinite precision library. Probably a waste of effort, though----just use IO formatting to round off any precision issues on the display.