From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <34C68D51-B2FF-4D3A-B4A0-C4B539CAD060@fastmail.fm> From: Ethan Grammatikidis To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Thu, 13 May 2010 16:54:32 +0100 References: <158d5dc0571fa04cab44a99b3fdf5921@kw.quanstro.net> <84f53dabe8357c852216d6c9024f6eb0@coraid.com> Subject: Re: [9fans] hoc output format Topicbox-Message-UUID: 207a430c-ead6-11e9-9d60-3106f5b1d025 On 13 May 2010, at 16:16, roger peppe wrote: > On 13 May 2010 15:23, erik quanstrom wrote: >> i typically do programming calculations and floating point >> just isn't the right way to do that. > > it's ok if you stick to 32 bit and don't do divisions. > > personally for off-the-cuff command-line calculations > i've been using my own "fc" for years and > years. nothing else quite hits the spot, but > i'm biased. > > my reasons: hoc doesn't do bit level ops, has too much syntax that > needs > quoting, and if you're quoting, it's awkward (in rc) to insert > environment variables inside the quotes. dc > doesn't take command line arguments, > doesn't do floating point and its output isn't suitable > for as input. what do you mean by "its output isn't suitable for use as input"? i'm just curious, have never used it that way. hum... having asked that question i tried some operations producing very lare numbers and they started to be printed with backslash-newlines in them. not nice, but such a form is suitable for input back to dc. > > there's a man page for the inferno version of fc here, > in case anyone's interested: > http://www.vitanuova.com/inferno/man/1/fc.html > fc does look good for strictly command line use (scripts, perhaps?) i usually want to fire up a calculator in a window of its own & refer to it as needed. -- Simplicity does not precede complexity, but follows it. -- Alan Perlis