////////////////////////////////////////////////////////////// //   階 乗 単 体 計 算 0.0.3 ////////////////////////////////////////////////////////////// function Factorial(String){ var String_Kai = eval(String); var String_Factorial="1"; now= new Date; var time=now.getTime(); for(now_Factorial=1;now_Factorial<=String_Kai;now_Factorial++){ var Factorial_A=String_Factorial; var Factorial_B=now_Factorial+""; String_Factorial=Factorial_Multiplication( Factorial_A , Factorial_B ); status=Factorial_B; } now2= new Date; time=(now2.getTime()-time)/1000; var Factorial_C = String_Factorial+","+time; return Factorial_C; } function Factorial_Multiplication(String_A_PointOut,String_B_PointOut){ //6桁区切りの計算の最大数 var limitA = Math.ceil(String_A_PointOut.length/6); var limitB = Math.ceil(String_B_PointOut.length/6); var AB = "0"; for(A_Loop=0 ; A_Loop String_B_2.length){var String_A_3=String_A_2;var String_B_3=String_B_2;} if(String_A_2.length < String_B_2.length){var String_A_3=String_B_2;var String_B_3=String_A_2;} if(String_A_2.length==String_B_2.length){var String_A_3="0"+String_A_2;var String_B_3=String_B_2;} var Up_String=0; var String_C_3=""; var String_C_2=""; var String_C=""; //加算 for(Mode_Plus=1 ; Mode_Plus<=String_A_3.length ; Mode_Plus++){ if(Mode_Plus>String_B_3.length){ Addition_B=0; }else{ Addition_B=eval(String_B_3.charAt(String_B_3.length-Mode_Plus)); } var A_B=Up_String+eval(String_A_3.charAt(String_A_3.length-Mode_Plus))+Addition_B; if(String(A_B).length==2){ Up_String=1; String_C_3+=String(eval(A_B)-10); }else{ Up_String=0; String_C_3+=String(A_B); } } String_C_3+=Up_String; //数列を逆にする for(String_C_3_SUB=1;String_C_3_SUB<=String_C_3.length;String_C_3_SUB++){ String_C_2+=String_C_3.charAt(String_C_3.length-String_C_3_SUB); } //左側の0を除去 z=1; while(z==1){ if(String_C_2.charAt(0)=="0"){String_C_2=String_C_2.substr(1,String_C_2.length-1);}else{break;} } if(String_C_2==""){String_C_2="0";} String_C+=String_C_2; return String_C; }