process-amath: add more functions for testing; handle overflow.