• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/Calc/Libs/MathLib.php
  • Класс: BitrixBizprocCalcLibsMathLib
  • Вызов: MathLib::callRand
public function callRand(Arguments $args)
{
	$min = (int)$args->getFirstSingle();
	$max = (int)$args->getSecondSingle();

	if (!$max || !is_finite($max))
	{
		$max = mt_getrandmax();
	}

	if ($min > $max)
	{
		//$args->getParser()->setError('rand(): Argument #2 ($max) must be greater than or equal to argument #1 ($min)');

		return null;
	}

	return mt_rand($min, $max);
}