From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <114211b71be26157069c0d33d02eda61@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] german keymap From: rog@vitanuova.com In-Reply-To: <7D060658.75466CAA@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 21 Apr 2004 20:16:50 +0100 Topicbox-Message-UUID: 67694f00-eacd-11e9-9e20-41e7f4b1d025 > how hard was that? i find the reverse-polish thing works really nicely on the command line. whatever the complexity of the expression, you can always add stuff to the end to operate on the previous result. the output is always suitable as input. if i've got some values in shell variables, the fact that you don't have to quote is really nice: % v=4000 % fc $v log 2 log / 12 % vs. % v=4000 % hoc -e 'log('$v')/log(2)' 11.96578428466 % it's also pleasant to be able to operate on lists of values. e.g. multiply a list of of numbers together: % d=(3.4 5.6 3.9 99) % fc $d x rep 7351.344 % neither awk nor hoc have anything like the complete set of math functions provided in libc.h. it's useful having these if you're experimenting with a mathematical expression in a program and want to know what the result is without compiling a program to do it. nor does hoc convert between bases, which is what prompted this whole discussion.