[calc] use bc if available (and imitate arbitrary precision using sed); POSIX-ify