Hi Paul,
thanks for this snippet!
Have you already seen the built-in min/max functions?
max((1,2,3)), min((1,2,3))
Might save both, some bytes and milliseconds, neglectable but
nevertheless. :-)
Best from Konstanz
Michael
On 15 Aug 2014, at 22:02, Paul Swennenhuis wrote:
Hi all,
Thanks for repyling, Dirk. I will delete the gray syntax from that wiki page.
Cheers,
Amanda
Date: Sun, 17 Aug 2014 07:44:16 +0200
From: Dirk Kirsten d...@basex.org
To: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Extra signature for fn:filter shown on wiki
page
Hi,
Is it intentional that random:integer lets you use zero or a negative value for
$max, but random:seeded-integer errors out in those cases? I know these are
edge cases. I'm only flagging them because of the inconsistency between the two
similar functions.
(: Returns (0,0). :)
Hello Amanda,
I agree, this behaviour is inconsistent. I am not quite sure what is the
best way to go here. Raising no error and simply returning 0 (as it is
currently done for random:integer() if max is out of range) seems pretty
dangerous to me, considering that randomness is often used for
4 matches
Mail list logo