473,474 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mt_rand

Happy New Year!

is there a way to save the internal position of the mersenne twister
(mt_rand) at the end of the php script (i.e. to session or database) and
start it again using the last generated number?

If not, do you know a opensource php version of the mersenne twister?

Regards,
Oliver

Jan 1 '06 #1
1 1725
In article <dp*************@news.t-online.com>,
"Oliver Benning" <ol****@treibhaus.ping.de> wrote:
is there a way to save the internal position of the mersenne twister
(mt_rand) at the end of the php script (i.e. to session or database) and
start it again using the last generated number?
Probably not.
If not, do you know a opensource php version of the mersenne twister?


It shouldn't be difficult to adapt one of these:
<http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/eversions.html>

--
philronan [@] blueyonder [dot] co [dot] uk
Jan 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kevin Lin | last post by:
Hi, The following script: <?php echo mt_rand();?> always outputs "1755202938" on my machine. I'm running PHP 4.2.3 under Windows XP. According to the docs:
12
by: Jim Michaels | last post by:
I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's...
1
by: geoffp | last post by:
Apparently seeding mt_srand with different integers can produce identical series of mt_rand results. Specifically, every pair of consecutive even and odd numbers produces the same series - see...
0
by: Akkad | last post by:
ok let met tell u what is the problem , i have downloaded the code GD library code from interent and when i am using it the picture is not appearing on the page. i don't know why ? i am using PHP...
9
by: newbie | last post by:
I am writing a DB like this: --------------------------------------------------------------------- | id (auto_incremented filed) | foo | bar |...
1
by: helraizer1 | last post by:
Hi all, I am making a captcha image for my site to stop bots and such. //captcha.php <?php session_start(); class CaptchaSecurityImages {
28
by: jatrojoomla | last post by:
Hi! could anyone give me some clue that how to create 'remember login' functionality during login Thanks Sukalyan
12
eragon
by: eragon | last post by:
Im trying to put a captcha image in my site to stop people from spamming, and when i view the image its self i get this: Fatal error: Call to undefined function imagettfbbox() in...
11
by: Twayne | last post by:
Hi, Learning PHP code; playing with various methods of generating captcha codes: In the code below, how would I change the size of the text displayed in the captcha code? Is it even possible...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.