calc77i: improve error checking in calc()
calc77i: improve power() and add test case that was used