Re: [j-nsp] format of minimum and maximum value of math:random() in SLAX

2018-07-06 Thread Phil Shafer
Martin T writes: >thanks! I didn't know about floor() function in XSLT/SLAX. However, >looks like in extremely rare cases math:random() can return 1 because >according to https://... >random number calculation can be "(double)RAND_MAX / >(double)RAND_MAX". So final solution should be

Re: [j-nsp] format of minimum and maximum value of math:random() in SLAX

2018-07-06 Thread Martin T
On Thu, Jul 5, 2018 at 11:37 PM Phil Shafer wrote: > > Michael Loftis writes: > >idk if there's a floor function but the general solution is floor(rand() * > >16) when rand() produces values 0-1(exclusive) IE if random does not > >generate 1.0 - dunno implementation details for slax > > Yes,

Re: [j-nsp] format of minimum and maximum value of math:random() in SLAX

2018-07-05 Thread Phil Shafer
Michael Loftis writes: >idk if there's a floor function but the general solution is floor(rand() * >16) when rand() produces values 0-1(exclusive) IE if random does not >generate 1.0 - dunno implementation details for slax Yes, XPath has a floor() function that can be used directly in SLAX.

Re: [j-nsp] format of minimum and maximum value of math:random() in SLAX

2018-07-05 Thread Michael Loftis
idk if there’s a floor function but the general solution is floor(rand() * 16) when rand() produces values 0-1(exclusive) IE if random does not generate 1.0 - dunno implementation details for slax On Thu, Jul 5, 2018 at 13:43 Martin T wrote: > Hi! > > According to the documentation,

[j-nsp] format of minimum and maximum value of math:random() in SLAX

2018-07-05 Thread Martin T
Hi! According to the documentation, math:random() function returns a random number with a minimum value of 0 and a maximum value of 1. Larger values than 0 and smaller values than 1 have a format similar to 0.663341003779015. What is the format of minimum and maximum value? Simply 0 and 1?