HP3000-L Archives

September 2013, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"James B. Byrne" <[log in to unmask]>
Reply To:
James B. Byrne
Date:
Tue, 10 Sep 2013 16:33:37 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
On Tue, September 10, 2013 13:00, Barry Lake wrote:
>
>>On Tue, Sep 10, 2013 at 8:33 AM, James B. Byrne wrote:
>>> ...I would like to calculate a formula with containing factors
>>> of arbitrary decimal precision and assign the integer result to
>>> a variable.  Inside the shell I can do this:
>>>
>>> shell/iX> x=$(echo "31.1 * 4.7" | bc)
>>> shell/iX> echo $x
>>> 146.1
> ...
>
>
> At 8:57 AM -0700 9/10/13, Donna Hofmeister wrote:
>>CI numeric variables only handle integers (whole numbers).
> ...
>>This is really sounding like something that's best handled by another
>>solution -- like a compiled program or maybe a perl script.
>

Yes, which is exactly what bc is, a complied program; and exactly what
it does, handle arbitrary precision variables.  All I want is to be
able to use it from inside a job stream such that I can return the
integer part of the result to an MPR/iX variable.

It strikes me as odd that this is proving to be as difficult as it
seems.  I put it down initially to my lack of familiarity with the
POSIX shell on the HP3000 but I sense the problem may go a little
deeper than simple ignorance on my part.


-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:[log in to unmask]
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2