// extended math library

var ExtMath = {

    getDegToRad: function(deg)
    {
        return deg * (Math.PI / 180);
    }
    
    // Haversine formula - calculates the distance between two points (coordinates)
    getGreatCircleDistance: function(lat1, lon1, lat2, lon2)
    {
        var p = 0.017453292519943295; // Math.PI / 180
        var c = Math.cos;
        var a = 0.5 - c((lat2 - lat1) * p)/2 + 
                c(lat1 * p) * c(lat2 * p) * 
                (1 - c((lon2 - lon1) * p))/2;

        return 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km
    }

    random: function (maxRange)
    {
        return Math.floor((Math.random() * maxRange) + 1);
    }

    randomEvenOnly: function (maxRange)
    {
        return Math.floor(Math.random() * maxRange / 2) * 2;
    }

};


@@ -116,16 +116,17 @@
 );%0A    %7D
+,
 %0A    %0A  
@@ -566,31 +566,35 @@
 371 km%0A    %7D
+,
 %0A%0A    
-r
+getR
 andom: funct
@@ -678,16 +678,17 @@
 );%0A    %7D
+,
 %0A%0A    ra
@@ -788,16 +788,259 @@
 2) * 2;%0A
+    %7D,%0A%0A    fibonacci: function (num, memo)%0A    %7B%0A        memo = memo %7C%7C %7B%7D;%0A%0A        if (memo%5Bnum%5D) return memo%5Bnum%5D;%0A        if (num %3C= 1)  return 1;%0A%0A        return memo%5Bnum%5D = this.fibonacci(num - 1, memo) + this.fibonacci(num - 2, memo);%0A
     %7D%0A%0A%7D

add fibonacci() to ExtMath library + rename random() to getRandom()