JavaScriptζSρ[~Ό]S
Kπ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" http://www.w3c.org/TR/html4/loose.dtd>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=Shift_JIS">
<meta http-equiv="Content-Type" content="text/javascript">
<style TYPE="text/css">
<!--
body { font-family : monospace ; }
table { background-color : #309933 ; }
td { background-color : #ffffff ; }
th { background-color : #ffffff ; }
-->
</style>
</head>
<body bgcolor="#ffffff">
<h3>vZvO</h3>
<script language="JavaScript" type="text/javascript">
function _add(){
return (this.x+this.y) ;
}
function _sub(){
return (this.x-this.y) ;
}
function _mul(){
return (this.x*this.y) ;
}
function _div(){
if(this.y==0){ document.write("Err:0ΕZ³κά΅½...") ; return(Inf) ; }
return (this.x/this.y) ;
}
function _and(){
return (this.x&this.y) ;
}
function _or(){
return (this.x|this.y) ;
}
function _xor(){
return (this.x^this.y) ;
}
function _shift_r(){
return (this.x>>this.y) ;
}
function _shift_r_2(){
return (this.x>>>this.y) ;
}
function _shift_l(){
return (this.x<<this.y) ;
}
function Calc(x,y){
this.x=x ;
this.y=y ;
this.add=_add ;
this.sub=_sub ;
this.mul=_mul ;
this.div=_div ;
}
function Calc_s(x,y){
this.base=Calc ;
this.base(x,y) ;
this.and=_and ;
this.or=_or ;
this.xor=_xor ;
}
Calc_s.prototype.shift_r=_shift_r ;
Calc_s.prototype.shift_r_2=_shift_r_2 ;
Calc_s.prototype.shift_l=_shift_l ;
var a=14,b=2 ;
var c=new Calc_s(a,b) ;
var str=new Array("+","-","*","/","&","|","^",">>",">>>","<<") ;
var ans=new Array(c.add(),c.sub(),c.mul(),c.div(),c.and(),c.or(),c.xor(),c.shift_r(),c.shift_r_2(),c.shift_l()) ;
document.write("vZl:a="+a+" , νvZl:b="+b+"<br>") ;
document.write("<br>") ;
document.write("<table>") ;
document.write("<tr>") ;
document.write("<th>l₯Z</th>") ;
for(i=0;i<4;i++){
document.write("<td>"+a+""+str[i]+""+b+"="+"<br>"+ans[i]+"</td>") ;
}
document.write("</tr>") ;
document.write("<tr>") ;
document.write("<th>_Z</th>") ;
for(i=4;i<str.length;i++){
document.write("<td>"+a+""+str[i]+""+b+"="+"<br>"+ans[i]+"</td>") ;
if(i==6){
document.write("</tr><tr>") ;
document.write("<th>rbgZ</th>") ;
}
}
document.write("</tr>") ;
document.write("</table>") ;
</script>
</body>
</html>
oΝΚ