This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: drand48() (and erand48) returns only zeros
- From: <meadmaker1066-cyg at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 12 Nov 2004 10:35:42 -0800 (PST)
- Subject: Re: drand48() (and erand48) returns only zeros
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=4KMZOEcsQzk8UdHfCvBRv16AXbwNzCFG0RsNaA6uQcCuR3RTbhsBzeE18EMsB6AzR2E+FhkS/qu+SYYddFI+TuMDv2KjdKRT65pLGk8xCQiB3HDppxWfa8FK6eV9zA/b0i3H+v7XdaLC8GMlajLlgaWA+DOcdYZ2gYSJayzY3Ew= ;
- Reply-to: meadmaker1066-cyg at yahoo dot com
Thanks for the prompt reply!
At 12:55 PM 11/12/2004 -0500, you wrote:
>If you're using C++, why use stdio functions?
The program has some modules from an older C program
and some from a C++ program. I just hadn't converted
all of the code. I left the headers in because in my
finished program I'd like to use both modules without
editing (plus my own new modules, which I could write
in either).
But for testing purposes I just stripped out the
program body except for the loop printing the drand48
and the includes except
<iostream>, <math.h>, and namespace std;
and tried it once with cout and a second time with
printf (i.e. the code below, compile and run then
comment out cout and uncomment printf compile and run)
so the ENTIRE program is now
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc,char* argv[]){
for (int i=0; i < 10; i++){
cout <<drand48()<<endl;
//printf("%lf\n",drand48());
}
return 0;
}
and in both cases it's still just zeros!
Any other thoughts?
Thank you!
Robert
>HTH,
> Igor
>--
> http://cs.nyu.edu/~pechtcha/
> |\ _,,,---,,_ pechtcha@cs.nyu.edu
>ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
> |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski,
Ph.D.
> '---''(_/--' `-'\_) fL a.k.a
JaguaR-R-R-r-r-r-.-.-. Meow!
>
>"The Sun will pass between the Earth and the Moon
tonight for a total
>Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27
2004, 12:01 pm EDT
>
--
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/