Код: Выделить всё
javascript:void((function(){var window_open = window.open('','calculator'+new Date().getTime(),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300');var document_open = window_open.document;document_open.open();document_open.write("<!DOCTYPE html PUBLIC %5C"-//W3C//DTD HTML 4.01 Transitional//EN%5C">%5Cn<html>%5Cn<head>%5Cn<title>Scientific Calculator</title>%5Cn<meta name=%5C"description%5C" content=%5C"Javascript calculator with calculation history, math functions, hexadecimal, octal, and scientific notation.%5C">%5Cn<meta name=%5C"keywords%5C" content=%5C"calculator, octal calculator, binary calculator, hexidecimal calculator, hexadecimal calculator, calc, calculate, calculater, scientific calculator, hex calculator, scientific notation calculator, javascript calculator, java script calculator, freeware calculator, free calculator, online calculator, calculater%5C">%5Cn<link rel=%5C"shortcut icon%5C" href=%5C"http://ostermiller.org/favicon.ico%5C" type=%5C"image/x-icon%5C">%5Cn<link rel=%5C"shortcut icon%5C" href=%5C"http://ostermiller.org/calc/calculator.ico%5C" type=%5C"image/x-icon%5C">%5Cn<script language=javascript type=%5C"text/javascript%5C"><!--%5Cnvar bo=%5C'%5C';var da=%5C'%5C';var bm=%5C'%5C';var bn=%5C'%5C'%5Cnvar br=false;var bg=1;var ck=%5C'(?:[0-9a-fA-F])%5C';var cb=%5C'(?:[0-9])%5C';var co=%5C'(?:[0-7])%5C';var cn=%5C'(?:[1-9])%5C';var cr=%5C'(?:[%5C%5C+]|[%5C%5C-])%5C';var ca=%5C'(?:(?:[0]|%5C'+cn+cb+%5C'*))%5C';var cp=%5C'(?:[0]%5C'+co+%5C'*)%5C';var cl=%5C'(?:[0](?:[x]|[X])%5C'+ck+%5C'+)%5C';var credInt=%5C'(?:%5C'+cr+%5C'?%5C'+cb+%5C'+)%5C';var cc=%5C'(?:[e]|[E])%5C';var cd=%5C'(?:%5C'+cc+credInt+%5C')%5C';var ce1=%5C'(?:%5C'+cb+%5C'+[%5C%5C.]%5C'+cb+%5C'*%5C'+cd+%5C'?)%5C';var cg=%5C'(?:[%5C%5C.]%5C'+cb+%5C'+%5C'+cd+%5C'?)%5C';var ch=%5C'(?:%5C'+cb+%5C'+%5C'+cd+%5C')%5C';var ci=%5C'(?:%5C'+cb+%5C'+)%5C';var ce=%5C'(?:%5C'+ce1+%5C'|%5C'+cg+%5C'|%5C'+ch+%5C'|%5C'+ci+%5C')%5C';var cv1=%5C'(?:[0]+[%5C%5C.][0]*%5C'+cd+%5C'?)%5C';var cx=%5C'(?:[%5C%5C.][0]+%5C'+cd+%5C'?)%5C';var cv3=%5C'(?:[0]+%5C'+cd+%5C')%5C';var cv4=%5C'(?:[0]+)%5C';var cv=%5C'(?:%5C'+cv1+%5C'|%5C'+cx+%5C'|%5C'+cv3+%5C'|%5C'+cv4+%5C')%5C';var ct=%5C'(?:[%5C%5Cn%5C%5C %5C%5Ct])%5C';var cq=%5C'(?:[%5C%5C(%5C%5C)%5C%5C+%5C%5C-%5C%5C/%5C%5C*%5C%5C|%5C%5C&%5C%5C,%5C%5C~%5C%5C^]|%5C%5C<%5C%5C<|%5C%5C>%5C%5C>|%5C%5C>%5C%5C>%5C%5C>|%5C%5C%)%5C'%5Cnvar cm=%5C'(?:E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2|abs|acos|asin|atan2|atan|ceil|cos|exp|floor|log|max|min|pow|random|round|sin|sqrt|tan)%5C'%5Cnvar cj=%5C'(?:(?:Math[%5C%5C.]%5C'+cm+%5C')|%5C'+cm+%5C')%5C';var bz=new RegExp(%5Cn cl+%5C'|%5C'+cp+%5C'|%5C'+ce+%5C'|%5C'+ca+%5C'|%5C'+%5Cn cv+%5C'|%5C'+ct+%5C'|%5C'+cq+%5C'|%5C'+cj+%5C'|ans%5C',%5C'g%5C'%5Cn);var E=Math.E;var LN10=Math.LN10;var LN2=Math.LN2;var LOG10E=Math.LOG10E;var LOG2E=Math.LOG2E;var PI=Math.PI;var SQRT1_2=Math.SQRT1_2;var SQRT2=Math.SQRT2;function abs(x){return Math.abs(x);}%5Cnfunction acos(x){return Math.acos(x);}%5Cnfunction asin(x){return Math.asin(x);}%5Cnfunction atan(x){return Math.atan(x);}%5Cnfunction atan2(x){return Math.atan2(x);}%5Cnfunction ceil(x){return Math.ceil(x);}%5Cnfunction cos(x){return Math.cos(x);}%5Cnfunction exp(x){return Math.exp(x);}%5Cnfunction floor(x){return Math.floor(x);}%5Cnfunction log(x){return Math.log(x);}%5Cnfunction max(x,y){return Math.max(x,y);}%5Cnfunction min(x,y){return Math.min(x,y);}%5Cnfunction pow(x,y){return Math.pow(x,y);}%5Cnfunction random(){return Math.random();}%5Cnfunction round(x){return Math.round(x);}%5Cnfunction sin(x){return Math.sin(x);}%5Cnfunction sqrt(x){return Math.sqrt(x);}%5Cnfunction tan(x){return Math.tan(x);}%5Cnfunction an(s){%5Cn var r=new RegExp(%5C"^((?:[a]|[^a])*)0[bB]([01]{1,32})((?:[a]|[^a])*)$%5C"); while(r.exec(s)){%5Cn s=RegExp.$1+%5C" %5C"+ah(RegExp.$2)+%5C" %5C"+RegExp.$3; }%5Cn return s;}%5Cnfunction am(s){%5Cn var r=new RegExp(%5C"^((?:[a]|[^a])*)ans((?:[a]|[^a])*)$%5C"); while(r.exec(s)){%5Cn s=RegExp.$1+%5C" %5C"+da+%5C" %5C"+RegExp.$2; }%5Cn return s;}%5Cnfunction ag(){%5Cn var ba=document.calculator.line.value; var bq=am(ba); bq=an(bq); if(bq!=bn&&bq!=bm&&!br){%5Cn var bv=bq.split(bz); var bw=0; for(var k=0;k<bv.length;k++){%5Cn if(bv[k].length!=0){%5Cn bw++; }%5Cn }%5Cn if(bw==0){%5Cn try{%5Cn var aw=%5C'%5C'+eval(bq); if(aw!=undefined){%5Cn bo=aw; da=aw; bm=%5C'%5C'; af(); aa(ba); ao(); }%5Cn }catch(ex){%5Cn alert(%5C'Error type: %5C'+ex.name+%5C'%5C%5Cn%5C'+%5C'Error message: %5C'+ex.message); bm=document.calculator.line.value; }%5Cn }else{%5Cn alert(bw+%5C' unknown tokens:%5C%5Cn%5C'+bv); bm=document.calculator.line.value; }%5Cn document.calculator.line.focus(); }%5Cn}%5Cnfunction aj(){%5Cn if(bn!=document.calculator.line.value){%5Cn bo=%5C'%5C'; }%5Cn}%5Cnfunction af(){%5Cn if(bo!=%5C'%5C'){%5Cn var db=document.calculator.display.selectedIndex; var bj=parseInt(bo); var bd=parseFloat(bo); var dj=%5C'%5C'; if(%5C'%5C'+bd!=%5C'NaN%5C'&&db==1){%5Cn dj=at(bo,false); }else if(%5C'%5C'+bd!=%5C'NaN%5C'&&db==2){%5Cn dj=at(bo,true); }else if(%5C'%5C'+bj!=%5C'NaN%5C'&&db==3){%5Cn dj=ar(bj); }else if(%5C'%5C'+bj!=%5C'NaN%5C'&&db==4){%5Cn dj=as(bj); }else if(%5C'%5C'+bj!=%5C'NaN%5C'&&db==5){%5Cn dj=aq(bj); }else{%5Cn dj=round_extra_sf(bd); }%5Cn bn=dj; document.calculator.line.value=dj; bg=1; document.calculator.line.style.backgroundColor=%5C'#aacc99%5C'; }else{%5Cn document.calculator.line.style.backgroundColor=%5C'#cccc99%5C'; }%5Cn}%5Cnfunction round_extra_sf(f){%5Cnvar s=f.toPrecision(14); s=s.replace(/^([%5C%5C+%5C%5C-0-9%5C%5C%5C%5C.]*[1-9%5C%5C.])0+((?:e[0-9%5C%5C+%5C%5C-]+)?)$/g,%5C'$1$2%5C'); s=s.replace(/%5C%5C.((?:e[0-9%5C%5C+%5C%5C-]+)?)$/g,%5C'$1%5C');return s;}%5Cnfunction at(s,eng){%5Cn var df=0; var bl=false; if(s.length>0&&s.charAt(0)==%5C'-%5C'){%5Cn bl=true; s=s.substring(1,s.length); }%5Cn var cu=s.split(new RegExp(%5C'[eE]%5C')); if(cu.length>1){%5Cn df=parseInt(cu[1]); s=cu[0]; }%5Cn cu=s.split(/[%5C%5C.]/); if(cu.length>1){%5Cn s=cu[0]+cu[1]; df+=cu[0].length-1; }else{%5Cn df+=s.length-1; }%5Cn var bp=0; for(bp=0;bp<s.length&&s.charAt(bp)==%5C'0%5C';bp++){%5Cn df=df-1; }%5Cn s=s.substring(bp,s.length); var bs; if(eng){%5Cn if(df>=0){%5Cn bs=(df%3)+1; }else{%5Cn bs=4-((-df)%3); if(bs==4){%5Cn bs=1; }%5Cn }%5Cn df-=(bs-1); }else{%5Cn bs=1; }%5Cn var dk=%5C'%5C'; for(var i=s.length;i<bs;i++){%5Cn dk+=%5C'0%5C'; }%5Cn return(%5Cn (bl?%5C'-%5C':%5C'%5C')+%5Cn ((s.length==0)?%5C'0%5C':s.substring(0,bs))+%5Cn ((s.length<=bs)?dk:(%5C'.%5C'+s.substring(bs,s.length)))+%5Cn ((s.length==0||df==0)?%5C'%5C':(%5C'e%5C'+df))%5Cn );}%5Cnvar bb=new Array(%5C'0%5C',%5C'1%5C',%5C'2%5C',%5C'3%5C',%5C'4%5C',%5C'5%5C',%5C'6%5C',%5C'7%5C',%5C'8%5C',%5C'9%5C',%5C'a%5C',%5C'b%5C',%5C'c%5C',%5C'd%5C',%5C'e%5C',%5C'f%5C');function ar(n){%5Cn var be=%5C'%5C'%5Cn var di=true; for(var i=32;i>0;){%5Cn i-=4; var by=(n>>i)&0xf; if(!di||by!=0){%5Cn di=false; be+=bb[by]; }%5Cn }%5Cn return %5C'0x%5C'+(be==%5C'%5C'?%5C'0%5C':be);}%5Cnfunction as(n){%5Cn var bx=%5C'%5C'%5Cn var di=true; for(var i=33;i>0;){%5Cn i-=3; var by=(n>>i)&0x7; if(!di||by!=0){%5Cn di=false; bx+=bb[by]; }%5Cn }%5Cn return %5C'0%5C'+(bx==%5C'%5C'?%5C'0%5C':bx);}%5Cnfunction aq(n){%5Cn var au=%5C'%5C'%5Cn var di=true; for(var i=32;i>0;){%5Cn i-=1; var by=(n>>i)&0x1; if(!di||by!=0){%5Cn di=false; au+=bb[by]; }%5Cn }%5Cn return %5C'0b%5C'+(au==%5C'%5C'?%5C'0%5C':au);}%5Cnfunction ah(s){%5Cn var au=0; var dh=0; var i=s.length-1; while(i>=0&&dh<32){%5Cn if(s.charAt(i)==%5C'1%5C'){%5Cn au|=1<<dh; }%5Cn dh++; i-=1; }%5Cn return au;}%5Cnfunction ap(s){%5Cn if(!br&&s!=%5C'%5C'){%5Cn bo=%5C'%5C'; bm=s; document.calculator.line.value=s; document.calculator.line.focus(); bm=%5C'%5C'; bn=%5C'%5C'; bg=1; document.calculator.line.style.backgroundColor=%5C'#cccc99%5C'; document.calculator.line.focus(); }%5Cn}%5Cnfunction ab(s,replaceLast){%5Cn if(!br&&s!=%5C'%5C'){%5Cn bo=%5C'%5C'; var bt%5Cn if(replaceLast==0&&document.calculator.line.value==bn){%5Cn bt=s; }else if(replaceLast==1&&document.calculator.line.value==bn){%5Cn bt=%5C'ans %5C'+s; }else{%5Cn bt=document.calculator.line.value+s; }%5Cn bm=bt; document.calculator.line.value=bt; document.calculator.line.focus(); bm=%5C'%5C'; bn=%5C'%5C'; bg=1; document.calculator.line.style.backgroundColor=%5C'#cccc99%5C'; document.calculator.line.focus(); }%5Cn}%5Cnfunction ac(){%5Cn document.calculator.line.value=%5C'%5C'; bg=1; document.calculator.line.style.backgroundColor=%5C'#cccc99%5C'; document.calculator.line.focus();}%5Cnfunction aa(s){%5Cn br=true; var bk=false; var dg=s; var bu; var bf=document.calculator.history.options; for(var i=1;i<bf.length&&!bk;i++){%5Cn bu=bf[i].text; bf[i].text=dg; if(bu==s){%5Cn bk=true; }%5Cn dg=bu; }%5Cn document.calculator.history.selectedIndex=0; br=false;}%5Cnfunction ak(){%5Cn br=true; var bf=document.calculator.history.options; var av=ai(%5C'calculatorState%5C'); if(av!=null&&av.length>1){%5Cn var bh=av.substring(1,av.length); if(bh!=null){%5Cn var bi=bh.split(%5C'%5C%5Cn%5C'); for(var i=1;i<bf.length&&i<bi.length+1;i++){%5Cn bf[i].text=bi[i-1]; }%5Cn }%5Cn document.calculator.display.selectedIndex=parseInt(av.charAt(0)); }%5Cn br=false;}%5Cnfunction ao(){%5Cn var bf=document.calculator.history.options; var av=document.calculator.display.selectedIndex; for(var i=1;i<bf.length;i++){%5Cn av+=bf[i].text+%5C'%5C%5Cn%5C'; }%5Cn var bc=new Date(); // cookie expires in one year%5Cn bc.setTime(bc.getTime()+365*24*60*60*1000); document.av=(%5Cn %5C'calculatorState%5C'+%5C'=%5C'+%5Cn escape(av)+%5Cn %5C';expires=%5C'+bc.toGMTString()%5Cn );}%5Cnfunction ai(name){%5Cn var az=name+%5C"=%5C"; var ax=document.cookie.indexOf(%5C";%5C"+az); if(ax==-1){%5Cn ax=document.cookie.indexOf(az); if(ax!=0)return null; }else{%5Cn ax+=2; }%5Cn var ay=document.cookie.indexOf(%5C";%5C",ax); if(ay==-1)ay=document.cookie.length; return unescape(document.cookie.substring(ax+az.length,ay));}%5Cnfunction ae(){%5Cn var bf=document.calculator.history.options; var bu=%5C"%5C"; if(bg>=bf.length||bf[bg].text==%5C"%5C"){%5Cn bg=1; }%5Cn if(bf[bg].text!=%5C"%5C"){%5Cn var de=bg; ap(bf[bg].text); bg=de; document.calculator.history.selectedIndex=bg; bg++; }%5Cn document.calculator.line.focus();}%5Cnfunction al(){%5Cn var d=document.calculator.display; var s=d.selectedIndex; s++; if(s>=d.options.length)s=0; ad(s)%5Cn}%5Cnfunction ad(index){%5Cn document.calculator.display.selectedIndex=index; af(); ao(); document.calculator.line.focus();}%5Cn--></script>%5Cn<style type=%5C"text/css%5C">%5Cnbody {%5Cnbackground-color:beige;font-size:10pt;}%5Cninput.advanced {%5Cnfont-size:9pt;width:.75cm;padding:0;margin:0;}%5Cninput.clear, input.number, input.operand, input.equal, input.other {%5Cnfont-size:15pt;}%5Cninput.clear, input.number, input.operand, input.equal, input.other {%5Cnwidth:1cm;font-weight:bold;padding:2px;}%5Cninput.keyshortcut {%5Cnbackground-color:beige;color:beige;text-decoration:none;border:none;}%5Cninput.clear {%5Cnbackground-color:#aa2222;border-color:#aa2222;color:white;}%5Cninput.number {%5Cnbackground-color:#CCaa99;border-color:#CCaa99;color:black;}%5Cninput.operand {%5Cnbackground-color:#aaaacc;border-color:#aaaacc;color:black;}%5Cninput.equal {%5Cnbackground-color:#444444;border-color:#444444;color:white;}%5Cninput.other {%5Cnbackground-color:#9ac693;border-color:#9ac693;color:black;}%5Cninput.advanced {%5Cnbackground-color:lightgray;border-color:lightgray;color:black;}%5Cninput.line {%5Cnbackground-color:#cccc99;border-color:#cccc99;font-size:15pt;font-weight:bold;width:100%;}%5Cnselect {%5Cnbackground-color:#cccccc;border-color:#cccccc;color:black;}%5Cn</style>%5Cn</head>%5Cn<body onload=%5C"ak();document.calculator.line.focus();%5C">%5Cn<noscript><p>This scientific calculator requires Javascript. Please enable Javascript%5Cnin your browser%5C's preferences and then reload this page if you wish to use this scientific calculator.</p></noscript>%5Cn<form name=calculator onSubmit=%5C"ag();return false;%5C">%5Cn<input class=line type=text name=%5C"line%5C" onChange=%5C"aj();%5C">%5Cn<br>%5Cn<table summary=%5C"Calculator%5C"><tr><td valign=top>%5Cn<table class=keypad summary=%5C"Button Keypad%5C"><tr>%5Cn<td><input type=%5C"button%5C" value=%5C"C%5C" class=%5C"clear%5C" accesskey=c onClick=%5C"ac();%5C" title=%5C"Clear (Alt-c)%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"(%5C" class=%5C"other%5C" onClick=%5C"ab(%5C'(%5C',0);%5C" title=%5C"Grouping Parenthesis%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C")%5C" class=%5C"other%5C" onClick=%5C"ab(%5C')%5C',0);%5C" title=%5C"Grouping Parenthesis%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"+%5C" class=%5C"operand%5C" onClick=%5C"ab(%5C' + %5C',1);%5C" title=%5C"Addition%5C"></td>%5Cn<td rowspan=5>%5Cn<input type=%5C"button%5C" value=%5C"&%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' & %5C',2);%5C" title=%5C"Bitwise And%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C"|%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' | %5C',2);%5C" title=%5C"Bitwise Or%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C"^%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' ^ %5C',2);%5C" title=%5C"Bitwise xOr%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C"~%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' ~ %5C',2);%5C" title=%5C"Bitwise Negation%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C"<<%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' << %5C',2);%5C" title=%5C"Bitwise Left Shift%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C">>%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' >> %5C',2);%5C" title=%5C"Bitwise Right Shift%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C"%%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C' % %5C',2);%5C" title=%5C"Modular Division%5C"><br>%5Cn<input type=%5C"button%5C" value=%5C",%5C" class=%5C"advanced%5C" onClick=%5C"ab(%5C', %5C',2);%5C" title=%5C"Comma for functions%5C"><br>%5Cn</td></tr><tr>%5Cn<td><input type=%5C"button%5C" value=%5C"7%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'7%5C',0);%5C" title=%5C"Seven%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"8%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'8%5C',0);%5C" title=%5C"Eight%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"9%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'9%5C',0);%5C" title=%5C"Nine%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"-%5C" class=%5C"operand%5C" onClick=%5C"ab(%5C' - %5C',1);%5C" title=%5C"Subtraction%5C"></td>%5Cn</tr><tr>%5Cn<td><input type=%5C"button%5C" value=%5C"4%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'4%5C',0);%5C" title=%5C"Four%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"5%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'5%5C',0);%5C" title=%5C"Five%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"6%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'6%5C',0);%5C" title=%5C"Six%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"*%5C" class=%5C"operand%5C" onClick=%5C"ab(%5C' * %5C',1);%5C" title=%5C"Multiplication%5C"></td>%5Cn</tr><tr>%5Cn<td><input type=%5C"button%5C" value=%5C"1%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'1%5C',0);%5C" title=%5C"One%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"2%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'2%5C',0);%5C" title=%5C"Two%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"3%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'3%5C',0);%5C" title=%5C"Three%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"÷%5C" class=%5C"operand%5C" onClick=%5C"ab(%5C' / %5C',1);%5C" title=%5C"Division%5C"></td>%5Cn</tr><tr>%5Cn<td><input type=%5C"button%5C" value=%5C"EE%5C" class=%5C"other%5C" onClick=%5C"ab(%5C'e%5C',2);%5C" title=%5C"Scientific Notation Exponent%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"0%5C" class=%5C"number%5C" onClick=%5C"ab(%5C'0%5C',0);%5C" title=%5C"Zero%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C".%5C" class=%5C"other%5C" onClick=%5C"ab(%5C'.%5C',2);%5C" title=%5C"Decimal Point%5C"></td>%5Cn<td><input type=%5C"button%5C" value=%5C"=%5C" class=%5C"equal%5C" accesskey=e onClick=%5C"ag();%5C" title=%5C"Enter (Alt-e)%5C"></td>%5Cn</tr></table>%5Cn</td><td valign=top>%5Cn<p><small>Display:</small><br>%5Cn<select name=display class=display onChange=%5C"af();ao();%5C" title=%5C"(Alt-d)%5C">%5Cn<option selected>Decimal (Mixed Notation)%5Cn<option>Decimal (Scientific Notation)%5Cn<option>Decimal (Engineering Notation)%5Cn<option>Hexadecimal%5Cn<option>Octal%5Cn<option>Binary%5Cn</select></p>%5Cn<p><select name=history class=history onChange=%5C"if(this.selectedIndex>0)ap(this.options[this.selectedIndex].text);%5C" title=%5C"View previous entries (Alt-h)%5C">%5Cn<option>History:%5Cn<option><option><option><option><option><option><option><option><option>%5Cn<option><option><option><option><option><option><option><option><option><option>%5Cn</select></p>%5Cn<p><select name=mathConstants class=mathConstants onChange=%5C"ab(this.options[this.selectedIndex].value,0);this.selectedIndex=0;%5C">%5Cn<option>Math Constants:%5Cn<option value=%5C"E %5C">e%5Cn<option value=%5C"LN10 %5C">ln(10)%5Cn<option value=%5C"LN2 %5C">ln(2)%5Cn<option value=%5C"LOG10E %5C">log10(e)%5Cn<option value=%5C"LOG2E %5C">log2(e)%5Cn<option value=%5C"PI %5C">π<option value=%5C"SQRT1_2 %5C">sqrt(1/2)%5Cn<option value=%5C"SQRT2 %5C">sqrt(2)%5Cn</select> <small>(<a target=%5C'_blank%5C' target=%5C"_blank%5C" href=%5C"http://www.javascripter.net/faq/mathcons.htm%5C">docs</a>)</small></p>%5Cn<p><select name=mathFunctions class=mathFunctions onChange=%5C"ab(this.options[this.selectedIndex].value,0);this.selectedIndex=0;%5C">%5Cn<option>Math Functions:%5Cn<option value=%5C"abs(%5C">abs%5Cn<option value=%5C"acos(%5C">acos%5Cn<option value=%5C"asin(%5C">asin%5Cn<option value=%5C"atan(%5C">atan%5Cn<option value=%5C"atan2(%5C">atan2%5Cn<option value=%5C"ceil(%5C">ceil%5Cn<option value=%5C"cos(%5C">cos%5Cn<option value=%5C"exp(%5C">exp%5Cn<option value=%5C"floor(%5C">floor%5Cn<option value=%5C"log(%5C">log%5Cn<option value=%5C"max(%5C">max%5Cn<option value=%5C"min(%5C">min%5Cn<option value=%5C"pow(%5C">pow%5Cn<option value=%5C"random()%5C">random%5Cn<option value=%5C"round(%5C">round%5Cn<option value=%5C"sin(%5C">sin%5Cn<option value=%5C"sqrt(%5C">sqrt%5Cn<option value=%5C"tan(%5C">tan%5Cn</select> <small>(<a target=%5C'_blank%5C' target=%5C"_blank%5C" href=%5C"http://www.javascripter.net/faq/mathfunc.htm%5C">docs</a>)</small></p>%5Cn<p><input type=%5C"button%5C" value=%5C"H%5C" accesskey=h class=%5C"keyshortcut%5C" onClick=%5C"ae();%5C">%5Cn<input type=%5C"button%5C" value=%5C"D%5C" accesskey=d class=%5C"keyshortcut%5C" onClick=%5C"al();%5C">%5Cn<input type=%5C"button%5C" value=%5C"M%5C" accesskey=m class=%5C"keyshortcut%5C" onClick=%5C"ad(0);%5C">%5Cn<input type=%5C"button%5C" value=%5C"S%5C" accesskey=s class=%5C"keyshortcut%5C" onClick=%5C"ad(1);%5C">%5Cn<input type=%5C"button%5C" value=%5C"G%5C" accesskey=g class=%5C"keyshortcut%5C" onClick=%5C"ad(2);%5C">%5Cn<input type=%5C"button%5C" value=%5C"B%5C" accesskey=b class=%5C"keyshortcut%5C" onClick=%5C"ad(5);%5C">%5Cn<input type=%5C"button%5C" value=%5C"O%5C" accesskey=o class=%5C"keyshortcut%5C" onClick=%5C"ad(4);%5C">%5Cn<input type=%5C"button%5C" value=%5C"X%5C" accesskey=x class=%5C"keyshortcut%5C" onClick=%5C"ad(3);%5C">%5Cn<input type=%5C"button%5C" value=%5C"A%5C" accesskey=a class=%5C"keyshortcut%5C" onClick=%5C"ab(%5C'ans %5C',0);%5C"></p>%5Cn</td></tr></table>%5Cn</form>%5Cn<div style=%5C"height:1in;%5C"></div>%5Cn<h3>Instructions</h3>%5Cn<table summary=%5C"List of keyboard shortcuts%5C" vspace=20 hspace=20 border=0 width=150 align=right><tr><td>%5Cn<b>Keyboard shortcuts (Alt or Cmd):</b><br>%5Cn<ul>%5Cn<li><u>C</u>lear</li>%5Cn<li><u>E</u>quals</li>%5Cn<li><u>H</u>istory (previous)</li>%5Cn<li><u>D</u>isplay (cycle)</li>%5Cn<li>Decimal <u>m</u>ixed display</li>%5Cn<li>Decimal <u>S</u>cientific display</li>%5Cn<li>Decimal En<u>g</u>ineering display</li>%5Cn<li><u>B</u>inary display</li>%5Cn<li><u>O</u>ctal display</li>%5Cn<li>He<u>x</u> display</li>%5Cn<li>Last <u>A</u>nswer</li>%5Cn</ul>%5Cn</td></tr></table>%5Cn<p>Enter an expression into the tan bar and press enter to calculate the results. </p>%5Cn<p>This calculator remembers up to twenty past calculations in history. To save the history%5Cnbetween visits you must have cookies enabled.</p>%5Cn<p>All results are calculated using the Javascript eval() function. Syntax for expressions%5Cnis the same as that for Javascript.</p>%5Cn<p>This calculator can handle input numbers in several different bases:</p>%5Cn<ul>%5Cn<li>Decimal (Base 10): Numbers that do not start with a zero like 15 or 3.14e15.%5CnDecimal numbers can contain digits 0-9, decimals, and scientific notation.</li>%5Cn<li>Hexadecimal (Base 16): Integers that start with a zero x like 0x1a5. Hexadecimal numbers%5Cncan contain digits 0-9 and a-f (or A-F) but no decimal or scientific notation.</li>%5Cn<li>Octal (Base 8): Integers that start with a zero like 073. Octal numbers%5Cncan contain digits 0-7 but no decimal or scientific notation.</li>%5Cn<li>Binary (Base 2): Integers that start with a zero b like 0b101. Binary numbers%5Cncan contain digits 0 and 1 but no decimal or scientific notation.</li>%5Cn</ul>%5Cn<p>^ is a bitwise xor operation. To raise a number to a power use pow() function.</p>%5Cn<hr>%5Cn<h3>License</h3>%5Cn<p>This program is free software;you can redistribute it and/or modify it%5Cnunder the terms of the GNU General Public License as published by the Free%5CnSoftware Foundation;either version 2 of the License, or (at your option)%5Cnany later version.</p>%5Cn<p>This program is distributed in the hope that it will be useful,%5Cnbut WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY%5Cnor FITNESS FOR A PARTICULAR PURPOSE. See the%5Cn<a target=%5C'_blank%5C' href=%5C"http://www.gnu.org/copyleft/gpl.html%5C">GNU%5CnGeneral Public License</a> for more details.</p>%5Cn<p style=%5C"text-size:small%5C">scientific calculater, binary calc, octal, hex, hexadecimal, hexidecimal</p>%5Cn<div style=%5C"padding:0.2cm;%5C"><a target=%5C'_blank%5C' href=%5C"http://ostermiller.org/calc/%5C">More converters, calculators, and other JavaScript goodies</a></div>%5Cn<div style=%5C"padding:0.2cm;text-align:right;%5C"><a target=%5C'_blank%5C' href=%5C"http://ostermiller.org/%5C">ostermiller.org</a> (<a target=%5C'_blank%5C' href=%5C"http://ostermiller.org/siteindex.html%5C">site index</a>)</div>%5Cn<div style=%5C"padding:0.2cm;%5C"><p>Copyright <a target=%5C'_blank%5C' href=%5C"http://ostermiller.org/contact.pl?regarding=JavaScript+Calculator%5C" class=mail>Stephen Ostermiller</a> 2002-2006</p></div>%5Cn</body>%5Cn</html>%5Cn");})())