| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <423DC28A.8030408@familiehaase.de> |
| Date: | Sun, 20 Mar 2005 19:35:54 +0100 |
| From: | "Gerrit P. Haase" <gp AT familiehaase DOT de> |
| Organization: | Esse keine toten Tiere |
| User-Agent: | Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.7.3) Gecko/20040910 |
| MIME-Version: | 1.0 |
| To: | Alex Vinokur <alexvn AT users DOT sourceforge DOT net> |
| CC: | cygwin AT cygwin DOT com, gcc-help AT gcc DOT gnu DOT org |
| Subject: | Re: g++ & rand() in Cygwin |
| References: | <d0u0pt$aj0$1 AT sea DOT gmane DOT org> |
| In-Reply-To: | <d0u0pt$aj0$1@sea.gmane.org> |
| X-IsSubscribed: | yes |
Alex Vinokur wrote:
> ------ foo.cpp ------
> #include <cstdlib>
> #include <iostream>
> using namespace std;
> int main ()
> {
> cout << rand() << endl;
> cout << rand() << endl;
> return 0;
> }
> ---------------------
>
>
> // g++ version 3.3.3 (cygwin special)
>
> $ g++ foo.cpp
>
> The program below generates the following output:
> -----------
> 0
> 1481765933
> -----------
>
> First pseuso-random number is 0.
>
> Is it by purpose?
I don't know. I use MT for random number generation:
http://anfaenger.de/cygwin/MersenneTwister/
Gerrit
--
=^..^=
Action Soccer: http://www.action-soccer.de/?lv=de&id=505
(german online game)
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |