📄 jsq.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>计算器</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Page-Enter content=blendTrans(Duration=0.5)>
<META http-equiv=Page-Exit content=blendTrans(Duration=0.5)>
<STYLE type=text/css>P {
FONT-SIZE: 9pt; FONT-FAMILY: "Verdana"
}
TD {
FONT-SIZE: 9pt; LINE-HEIGHT: normal
}
A {
FONT-SIZE: 9pt; TEXT-TRANSFORM: none; COLOR: #326969; TEXT-DECORATION: none
}
A:hover {
FONT-SIZE: 9pt; LEFT: 1px; COLOR: #0000ff; POSITION: relative; TOP: 1px; TEXT-DECORATION: none
}
BODY {
FONT-SIZE: 9pt; CURSOR: url('body.cur'); SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-BASE-COLOR: #cde0c2
}
.diary_tb {
WIDTH: 100%; WORD-BREAK: break-all; FONT-FAMILY: "Verdana","宋体"; POSITION: relative; TEXT-ALIGN: center; WORD-WRAP: break-word
}
.diary_main {
TABLE-LAYOUT: fixed; BACKGROUND-POSITION: left top; FONT-SIZE: 12px; COLOR: #005782; WORD-BREAK: break-all; LINE-HEIGHT: 24px; FONT-FAMILY: "宋体"; LINE-BREAK: strict; HEIGHT: 2px; TEXT-ALIGN: left
}
</STYLE>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<CENTER>
<TABLE id=AutoNumber2 style="BORDER-COLLAPSE: collapse" borderColor=#808080
cellSpacing=0 cellPadding=0 width=760 border=0>
</TABLE>
<SCRIPT language=javascript><!--var endNumber=truevar mem=0var carry=10var hexnum="0123456789abcdef"var angle="d"var stack=""var level="0"var layer=0//数字键function inputkey(key){var index=key.charCodeAt(0);if ((carry==2 && (index==48 || index==49))|| (carry==8 && index>=48 && index<=55)|| (carry==10 && (index>=48 && index<=57 || index==46))|| (carry==16 && ((index>=48 && index<=57) || (index>=97 && index<=102))))if(endNumber){endNumber=falsedocument.calc.display.value = key}else if(document.calc.display.value == null || document.calc.display.value == "0")document.calc.display.value = keyelsedocument.calc.display.value += key}function changeSign(){if (document.calc.display.value!="0")if(document.calc.display.value.substr(0,1) == "-")document.calc.display.value = document.calc.display.value.substr(1)elsedocument.calc.display.value = "-" + document.calc.display.value}//函数键function inputfunction(fun,shiftfun){endNumber=trueif (document.calc.shiftf.checked)document.calc.display.value=decto(funcalc(shiftfun,(todec(document.calc.display.value,carry))),carry)elsedocument.calc.display.value=decto(funcalc(fun,(todec(document.calc.display.value,carry))),carry)document.calc.shiftf.checked=falsedocument.calc.hypf.checked=falseinputshift()}function inputtrig(trig,arctrig,hyp,archyp){if (document.calc.hypf.checked)inputfunction(hyp,archyp)elseinputfunction(trig,arctrig)}//运算符function operation(join,newlevel){endNumber=truevar temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.valuewhile (newlevel!=0 && (newlevel<=(level.charAt(level.length-1)))){temp=parse(temp)level=level.slice(0,-1)}if (temp.match(/^(.*\d[\+\-\*\/\%\^\&\|x])?([+-]?[0-9a-f\.]+)$/))document.calc.display.value=RegExp.$2stack=stack.substr(0,stack.lastIndexOf("(")+1)+temp+joindocument.calc.operator.value=" "+join+" "level=level+newlevel}//括号function addbracket(){endNumber=truedocument.calc.display.value=0stack=stack+"("document.calc.operator.value=" "level=level+0layer+=1document.calc.bracket.value="(="+layer}function disbracket(){endNumber=truevar temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.valuewhile ((level.charAt(level.length-1))>0){temp=parse(temp)level=level.slice(0,-1)}document.calc.display.value=tempstack=stack.substr(0,stack.lastIndexOf("("))document.calc.operator.value=" "level=level.slice(0,-1)layer-=1if (layer>0)document.calc.bracket.value="(="+layerelsedocument.calc.bracket.value=""}//等号function result(){endNumber=truewhile (layer>0)disbracket()var temp=stack+document.calc.display.valuewhile ((level.charAt(level.length-1))>0){temp=parse(temp)level=level.slice(0,-1)}document.calc.display.value=tempdocument.calc.bracket.value=""document.calc.operator.value=""stack=""level="0"}//修改键function backspace(){if (!endNumber){if(document.calc.display.value.length>1)document.calc.display.value=document.calc.display.value.substring(0,document.calc.display.value.length - 1)elsedocument.calc.display.value=0}}function clearall(){document.calc.display.value=0endNumber=truestack=""level="0"layer=""document.calc.operator.value=""document.calc.bracket.value=""}//转换键function inputChangCarry(newcarry){endNumber=truedocument.calc.display.value=(decto(todec(document.calc.display.value,carry),newcarry))carry=newcarrydocument.calc.sin.disabled=(carry!=10)document.calc.cos.disabled=(carry!=10)document.calc.tan.disabled=(carry!=10)document.calc.bt.disabled=(carry!=10)document.calc.pi.disabled=(carry!=10)document.calc.e.disabled=(carry!=10)document.calc.kp.disabled=(carry!=10)document.calc.k2.disabled=(carry<=2)document.calc.k3.disabled=(carry<=2)document.calc.k4.disabled=(carry<=2)document.calc.k5.disabled=(carry<=2)document.calc.k6.disabled=(carry<=2)document.calc.k7.disabled=(carry<=2)document.calc.k8.disabled=(carry<=8)document.calc.k9.disabled=(carry<=8)document.calc.ka.disabled=(carry<=10)document.calc.kb.disabled=(carry<=10)document.calc.kc.disabled=(carry<=10)document.calc.kd.disabled=(carry<=10)document.calc.ke.disabled=(carry<=10)document.calc.kf.disabled=(carry<=10)}function inputChangAngle(angletype){endNumber=trueangle=angletypeif (angle=="d")document.calc.display.value=radiansToDegress(document.calc.display.value)elsedocument.calc.display.value=degressToRadians(document.calc.display.value)endNumber=true}function inputshift(){if (document.calc.shiftf.checked){document.calc.bt.value="deg "document.calc.ln.value="exp "document.calc.log.value="expd"if (document.calc.hypf.checked){document.calc.sin.value="ahs "document.calc.cos.value="ahc "document.calc.tan.value="aht "}else{document.calc.sin.value="asin"document.calc.cos.value="acos"document.calc.tan.value="atan"}document.calc.sqr.value="x^.5"document.calc.cube.value="x^.3"document.calc.floor.value="小数"}else{document.calc.bt.value="d.ms"document.calc.ln.value=" ln "document.calc.log.value="log "if (document.calc.hypf.checked){document.calc.sin.value="hsin"document.calc.cos.value="hcos"document.calc.tan.value="htan"}else{document.calc.sin.value="sin "document.calc.cos.value="cos "document.calc.tan.value="tan "}document.calc.sqr.value="x^2 "document.calc.cube.value="x^3 "document.calc.floor.value="取整"}}//存储器部分function clearmemory(){mem=0document.calc.memory.value=" "}function getmemory(){endNumber=truedocument.calc.display.value=decto(mem,carry)}function putmemory(){endNumber=trueif (document.calc.display.value!=0){mem=todec(document.calc.display.value,carry)document.calc.memory.value=" M "}elsedocument.calc.memory.value=" "}function addmemory(){endNumber=truemem=parseFloat(mem)+parseFloat(todec(document.calc.display.value,carry))if (mem==0)document.calc.memory.value=" "elsedocument.calc.memory.value=" M "}function multimemory(){endNumber=truemem=parseFloat(mem)*parseFloat(todec(document.calc.display.value,carry))if (mem==0)document.calc.memory.value=" "elsedocument.calc.memory.value=" M "}//十进制转换function todec(num,oldcarry){if (oldcarry==10 || num==0) return(num)var neg=(num.charAt(0)=="-")if (neg) num=num.substr(1)var newnum=0for (var index=1;index<=num.length;index++)newnum=newnum*oldcarry+hexnum.indexOf(num.charAt(index-1))if (neg)newnum=-newnumreturn(newnum)}function decto(num,newcarry){var neg=(num<0)if (newcarry==10 || num==0) return(num)num=""+Math.abs(num)var newnum=""while (num!=0){newnum=hexnum.charAt(num%newcarry)+newnumnum=Math.floor(num/newcarry)}if (neg)newnum="-"+newnumreturn(newnum)}//表达式解析function parse(string){if (string.match(/^(.*\d[\+\-\*\/\%\^\&\|x\<])?([+-]?[0-9a-f\.]+)([\+\-\*\/\%\^\&\|x\<])([+-]?[0-9a-f\.]+)$/))return(RegExp.$1+cypher(RegExp.$2,RegExp.$3,RegExp.$4))elsereturn(string)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -