At 4:33 PM -0400 9/10/13, James B. Byrne wrote:
>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.
It was never clear until just now what you wanted. If you're happy
with truncating your arithmetic result, that is, lopping off
everything to the right of the decimal point, including the decimal
point, then here's one way to do it:
/SYS/PUB $ echo "31.1 * 4.7" | bc
146.1
/SYS/PUB $ echo "31.1 * 4.7" | bc | cut -f1 -d.
146
/SYS/PUB $ callci setvar result $(echo "31.1 * 4.7" | bc | cut -f1 -d.)
/SYS/PUB $ callci showvar result
RESULT = 146
/SYS/PUB $ exit
END OF PROGRAM
: showvar result
RESULT = 146
:
--
Barry Lake mailto:[log in to unmask]
Allegro Consultants, Inc. http://www.allegro.com
(408)252-2330
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *