On Mon, Sep 11, 2017 at 10:16:50PM +0200, Timo Paulssen wrote:
> the first expression uses ^ as a prefix operator on *, so it gives you
> "a list of numbers 0 through * - 1" instead of "the number *" to compare
> against *, so it's as if you had rounded the value up before comparing to 2.
and now
the first expression uses ^ as a prefix operator on *, so it gives you
"a list of numbers 0 through * - 1" instead of "the number *" to compare
against *, so it's as if you had rounded the value up before comparing to 2.
On Mon, Sep 11, 2017 at 10:07:32PM +0200, Timo Paulssen wrote:
> If I understand your problem correctly, you can simply use ...^ to leave
> out the last element :)
wow ... i tried it once but failed. and now i just spotted the error:
i wrote
(116, * * .6 ... ^ * < 2 ).say
instead of
On Mon, Sep 11, 2017 at 10:01 PM, Marc Chantreux <kha...@phear.org> wrote:
> hello,
>
> doing maths with my kid, i just translated his spreadsheet with those
> lines of haskell:
>
> rebonds height loss = height : rebonds (height - height * loss)
> loss
>
= height : rebonds (height - height * loss) loss
> main = print $ takeWhile (> 2) $ rebonds 116 0.6
>
> then i wanted to make it as short as possible in perl6, i'm almost
> there:
>
> (116, * * .6 ... * < 2 ).say
>
> but the first $_ < 2 remains in the
hello,
doing maths with my kid, i just translated his spreadsheet with those
lines of haskell:
rebonds height loss = height : rebonds (height - height * loss) loss
main = print $ takeWhile (> 2) $ rebonds 116 0.6
then i wanted to make it as short as possible in perl6, i'm alm