Thanks Rob,

My first try was sqrt as part of spec but it didn't work, hence my
question.

I'll have to wait a couple of moths for vm 6.4 but thanks for the heads up,
I can wait and in the meantime kludge something together to get me by.
I have an exec that calculates sqrt so I'll use that.

Nice to see the enhancements, I'll have to start reading up. :-)

Cheers,
Don


On Fri, Apr 21, 2017 at 16:22 Rob van der Heij <[email protected]>
wrote:

> > Is there a pipe stage I can use to calculate the square root of a value?
> >
> > I wrote a stage that reads a stream of numbers, and I'd like to calculate
> > the Std deviation.  For the last part I need to take the square root of a
> > sum.
>
> Sure, you can do that (we're talking z/VM 6.4 here)
>
>  pipe literal 123 | spec a:w1 - set #0:=a print sqrt(#0) pic zz9.999 1 |
> cons
>
> But I would let CMS Pipelines do the heavy lifting:
>
>  pipe literal 1.1 1.2 1.3 1.25                    /* Sample data    */
>      | split
>      | spec printonly eof a:w1 - eof              /* Only do totals */
>             print average(a) pic zzzz9.999 1
>             print stddev(a) pic zzzz9.999 nw
>      | cons
>
> Happy Plumbing,
> Sir Rob the Plumber
>
--
Sent from iPhone Gmail Mobile

Reply via email to