Branch: Tag:

2016-03-30

2016-03-30 06:04:19 by Martin Nilsson <nilsson@fastmail.com>

Change to the same forgiving behaviour as random() for non-bignums when applied to 0 and negative numbers.

2052:    if (args != 2)    SIMPLE_WRONG_NUM_ARGS_ERROR("_random", 2);    if(mpz_sgn(THIS) <= 0) -  Pike_error("Random on zero or negative number.\n"); +  { +  push_int(0); +  return; +  }       /* On stack: random_string, random */    pop_stack();