Skip to content

Commit dda7ac3

Browse files
committed
cleanup variable and syntax
1 parent 5424c48 commit dda7ac3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/special.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Special functions //
22
(function( jStat, Math ) {
33

4-
// private functions
5-
6-
74
// extending static jStat methods
85
jStat.extend({
96

@@ -414,21 +411,23 @@ jStat.extend({
414411
// If n and m are specified it returns a jstat object of normal deviates.
415412
randn : function( n, m ) {
416413
m = m || n;
414+
415+
var u, v, x, y, q, mat;
416+
417417
if( n ) {
418-
var mat = jStat.zeros( n,m );
418+
mat = jStat.zeros( n,m );
419419
mat.alter(function() {return jStat.randn();} );
420420
return mat;
421421
}
422-
var u, v, x, y, q;
423422

424423
do {
425424
u = Math.random();
426425
v = 1.7156 * ( Math.random() - 0.5 );
427426
x = u - 0.449871;
428427
y = Math.abs( v ) + 0.386595;
429428
q = x*x + y * ( 0.19600 * y - 0.25472 * x );
430-
} while( q > 0.27597
431-
&& ( q > 0.27846 || v*v > -4 * Math.log( u ) * u*u ) );
429+
} while( q > 0.27597 && ( q > 0.27846 || v*v > -4 * Math.log( u ) * u*u ) );
430+
432431
return v / u;
433432
},
434433

0 commit comments

Comments
 (0)