Hello Monks, may the peace of computing be with you,
I'm looking for some new syntax for a script that calculates conjunctions based on the ephemera as provided by the good people at fourmilab. As it is now, I find myself making static calls to a median function which causes execution to follow the same course every time. This is boring the heck out of me and does not allow me to see how things run under slightly-differing scenarios.
What follows are the call and subroutine.
my $guess = median( $upper, $lower ); say "guess is $guess"; sub median { my ( $up, $low ) = @_; my $return = ( $up + $low ) / 2.0; return $return; }
I seek to re-write these as being "close to half" as opposed to half.
I've seen treatments of perl that generate domains using ellipses, but I seek one on the reals. These are represented in perl logic by floats.
The first routine I would like to define is one that returns a float on a uniform interval between .4 and .6, generated stochastically. The other one I seek is a similar such with a normal distribution.
Thank you for your comment,
In reply to subroutines for close to half by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |