471,330 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

How to get a random long number ?

FX
Hi all,
How can I get a random long number ?

(nb: Random class allows me to generate only int number, I would like number
possibly greater than int.MaxValue)
Dec 28 '05 #1
1 10255
Get 2 random Integers, shift the first left 32 bits, and OR them together.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"FX" <kf*@free.fr.nospam> wrote in message
news:43**********************@news.free.fr...
Hi all,
How can I get a random long number ?

(nb: Random class allows me to generate only int number, I would like
number possibly greater than int.MaxValue)

Dec 28 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Jason | last post: by
4 posts views Thread by Jack | last post: by
70 posts views Thread by Ben Pfaff | last post: by
5 posts views Thread by Peteroid | last post: by
104 posts views Thread by fieldfallow | last post: by
13 posts views Thread by Peter Oliphant | last post: by
reply views Thread by urkel | last post: by
16 posts views Thread by jason.cipriani | last post: by

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.