PageSourceSearch

https://www.laskurini.fi/scripts-built/app/Mean.js?v=1.0.9679.26429

js laskurini.fi collected 2026-09-24 20:45:42 UTC 1,574 bytes, 1 lines download raw bytes

1define("Mean",["require","exports","Common/Common","Common/Common"],function(require,exports,common){"use strict";function isNum(e){var a=e,r=!0;if(""==a||null==a||0==a.length)return!1;a=a.toString();for(var t=0;t<a.length;t++)if(a.substring(t,t+1)<"0"||a.substring(t,t+1)>"9"){if("."!=a.substring(t,t+1))return!1;if(1!=r)return!1;r=!1}return!0}function calculate(){var vva=$("#inputValues").val();vva=vva.replace(" ","");var resul,bb=!0;""!=vva&&(resul=vva.split(","));for(var v=0;v<resul.length;v++){var d=resul[v];if(isNaN(d)||""==d){alert(common.format(_r.NumberNotValid,d)),bb=!1;break}}if(1==bb){var tot=resul.length,mean=0;$("#numberCount").text(tot);for(var c=0;c<tot;c++)mean+=parseFloat(resul[c]);mean/=tot,$("#resultMean").text(Math.round(1e5*mean)/1e5);var resal=sorting(resul),median=0;if(tot%2==0){var sdd="("+parseFloat(resal[tot/2-1])+"+"+parseFloat(resal[tot/2])+")/2";median=sdd+" = "+eval(sdd)}else median=resal[(tot-1)/2];$("#resultMedian").text(median),$("#resultOrder").text(resal.join(", "));var modeval=0,maxval=0,mode,curval;curval=resal[0];for(var z=0;z<=tot;z++){var zval=resal[z];zval==curval?(modeval+=1)>maxval&&(mode=curval,maxval=modeval):(modeval==maxval&&mode!=curval&&(mode=mode+","+curval),curval=zval,modeval=1)}$("#resultMode").text(mode)}}function sorting(e){for(var a=!0,r=0,t=e.length;1==a;){for(var l=r+1;l<t;l++){var o=parseFloat(e[r]),n=parseFloat(e[l]);o>n&&(e[r]=n,e[l]=o)}r+=1,r>=t&&(a=!1)}return e}Object.defineProperty(exports,"__esModule",{value:!0}),common.init(),$(function(){$("#doCalc").click(calculate),calculate()})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.