drand48()

Guangliang He ghe at physics.orst.edu
Thu May 9 07:46:54 AEST 1991


Can anyone tell me what kind result I should expect from the following little
C program?
-----
#include <stdio.h>

main()
{
    int i;

    for (i = 0; i < 10; i++)
        printf("%e\n", drand48());
}
-----

The answer I got from a RS/6000 is following:
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154
1.531272e-154

While the answer from a SUN is
3.964646e-01
8.404851e-01
3.533361e-01
4.465833e-01
3.186927e-01
8.864284e-01
1.558284e-02
5.840898e-01
1.593685e-01
3.837159e-01


What is the problem on RS/6000? Is it a BUG in drand48() or is it 'work
as designed'??? :-( :-(

---
  Guangliang He                |  -----Go Blazers!-----
  ghe at physics.orst.edu         |  -----Go Blazers!-----            



More information about the Comp.unix.aix mailing list