~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to raster/r.random.surface/gasdev.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* gasdev.c                                                             */
2
 
 
3
 
#undef TRACE
4
 
#undef DEBUG
5
 
 
6
2
#undef MAIN
7
3
#include <math.h>
8
4
#include "ransurf.h"
9
5
#include "local_proto.h"
10
6
 
11
 
 
12
7
/* GasDev() returns a random double with a mean of 0.0 and a standard   */
13
8
/*      deviation of 1.0.                                               */
14
9
double GasDev(void)
22
17
    } while (r >= 1.0);
23
18
 
24
19
    fac = sqrt(-2.0 * log(r) / r);
25
 
    DOUBLE(v2 * fac);
 
20
    G_debug(3, "(v2 * fac):%.12lf", v2 * fac);
26
21
 
27
22
    return (v2 * fac);
28
23
}