For simplicity of implementation, use the minimal standard generator
described in "Random Number Generators: Good ones are hard to find"
by Park & Miller (ACM 1988, Volume 31, Number 10).
The 'length' field of a function is used to fill in missing arguments
with undefined; this does not mesh well with functions that query for
missing arguments using js_gettop. Set their lengths to 0 instead.
In case of no arguments +-Infinity should be returned. -0 is
smaller than +0 and any NaN input should turn the result into NaN.
(because of the NaN semantics libc fmin, fmax cannot be used: they
return the other argument if one is NaN)
Math.pow has subtly different semantics than ISO C pow for the
non-finite powers of +-1, so that's handled separately.
(ECMA requires NAN result, in ISO C Annex F pow(1,any) == 1 and
pow(-1,+-inf) == 1)