Article View: borland.public.jbuilder.java.language
Article #19364Random numbers
From: Tim Shelley
Date: Mon, 16 Feb 1998 00:00
Date: Mon, 16 Feb 1998 00:00
13 lines
893 bytes
893 bytes
Hi, Does anyone know how to create random numbers inbetween a specific range - not by using the Randomizer class. I vaguely remember some old C++ syntax that used the Rand() to produce a random number between 0.0 and 0.1 then you would use '%' to get a number, i.e. number = Rand() % 6; - would give you a number between 0 and six I'm not sure about the code above, its only a vague memory of how I used to do it in C++.
Technical Details
Message-ID:
<34E8383B.DB443CA3@objectuk.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e3b842f44ef18411,start X-Google-Attributes: gidf74b3,public From: Tim Shelley <tim_shelley@objectuk.co.uk> Subject: Random numbers Date: 1998/02/16 Message-ID: <34E8383B.DB443CA3@objectuk.co.uk> X-Deja-AN: 325530812 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: None Newsgroups: borland.public.jbuilder.java.language