diff --git a/spec/helpers/spec-helper.js b/spec/helpers/spec-helper.js index 3e515d13..9cd88752 100644 --- a/spec/helpers/spec-helper.js +++ b/spec/helpers/spec-helper.js @@ -63,9 +63,12 @@ global.expect = function(e) { */ toBeEqualish: function(a) { - if (typeof(e) == 'number') + if (typeof(e) == 'number') { + if(isNaN(e) !== isNaN(a)) + expected(e, "to be equalish to", a); if(Math.abs(e - a) >= EPSILON) expected(e, "to be equalish to", a); + } if (e.length != a.length) assert.fail(e.length, a.length, "length mismatch"); diff --git a/src/gl-matrix/vec4.js b/src/gl-matrix/vec4.js index c04c6aa9..f743b0e9 100644 --- a/src/gl-matrix/vec4.js +++ b/src/gl-matrix/vec4.js @@ -409,8 +409,8 @@ export function lerp(out, a, b, t) { * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned * @returns {vec4} out */ -export function random(out, vectorScale) { - vectorScale = vectorScale || 1.0; +export function random(out, scale) { + scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.