Your requirements are quite strict and I'm not sure that this suggestion meets them completely, but it sounds like you are describing close to the ideal use case for bc
, the arbitrary precision calculator language. You can download the source code for the latest version from the GNU Project Archives
and read the man page on die.net
: Although BusyBox
does not include bc
, you could probably accomplish what you are looking for using the combination of sh
, and grep
it includes, albeit much less elegantly. BusyBox also gives you the option of selecting features at compile time, so you could choose not to include features you don't need.