示例#1
0
double sl_urandom() /* sl_proto, sl_func sl_urandom */
{
    double r[1] = { 0 };

#if defined(HAVE_ESSL_H)
    /*  printf("durand\n");*/
    durand(&sl_urandom_seed, 1, r);
#elif defined(HAVE_T4C_H)
    /*  printf("t4c_durand\n");*/
    t4c_durand(r);
#endif

    /*  printf("sl_urandom: %f\n", r[0]);*/

    return r[0];
}
示例#2
0
double z_urandom() /* z_proto, z_func z_urandom */
{
  double r[1] = { 0 };

#if defined(HAVE_ESSL_H)
/*  printf("durand\n");*/
  durand(&z_urandom_seed_essl, 1, r);
#elif defined(HAVE_T4C_H)
/*  printf("t4c_durand\n");*/
  t4c_durand(r);
#else
/*  printf("random() / RAND_MAX\n");*/
  r[0] = (double) z_rand() / (double) Z_RAND_MAX;
#endif

/*  printf("z_urandom: %f\n", r[0]);*/

  return r[0];
}