Jump to: navigation, search

Php lcg value

From w3cyberlearnings

Contents

PHP function lcg_value

This function returns a pseudo random number in a range between 0 and 1.

Syntax lcg_value

lcg_value()

Example 1

<?php

echo lcg_value();
echo "<br/>";
echo lcg_value();
?>

Output

0.3374541181848
0.41332178385595

Example 2

<?php

echo pow(2, 4) * lcg_value();
echo "<br/>";
echo pow(2, 5) * lcg_value();
?>

Output

6.4865359867339
1.1806623065413

Related Links


Navigation
Web
SQL
MISC
References