JavaScript programmable calculator



DEC BIN OCT HEX






Simple programmable calculator
by JavaScript
Version 1.3 (Japanese)

Upper box: Input
Lower box: Output
double click-->mobile size
(changed by Safari 5 --> invalid)

<< for Copy & Paste >>

.toUpperCase(); .toLowerCase();
new Array(); new Date();
Math.log(); Math.exp();
Math.max(,); Math.min(,);
Math.sin(); Math.cos();
Math.tan(); Math.asin();
Math.acos(); Math.atan();
Math.round();Math.abs();

<< Input Samples >>

Ex1. Add/Sub/Mul/Div
(123+12)*100-200/100
Ex2. Hex
(0xABCDE+0x10000)+256
Ex3. a*x*x + b*x + c
x=2;
a=2; b=3; c=4;
a*x*x + b*x + c
Ex4. day of the week
(DEC check)
week = new Array("SUN","MON",
"TUE","WED","THU","FRI","SAT");
today=new Date();
"Today is " +
week[today.getDay()] + "."
Ex5. the 4th power of 2
+ Root2 * 3

Math.pow(2,4) + Math.sqrt(2) * 3
Ex6. r * r * PI
r=2.01; r * r * Math.PI
Ex7. Janken
janken = new Array("rock",
"scissors","paper");
index = Math.floor
(Math.random()*3);
janken[index]
Ex8. use "for"
s1=0; s2=0; s3=0;
for (i=0; i<5; i++) {
s1++; s2+=s1; s3+=s2;
}
"s1="+s1+",s2="+s2+",s3="+s3

<< Operation >>

1). Input JavaScript code
--> Input box
2). Click "=" button
--> Output box
Radio button (Default:DEC)
DEC: Evaluate and display
BIN: Evaluate (display by BIN)
OCT: Evaluate (display by OCT)
HEX: Evaluate (display by HEX)
(BIN,OCT,HEX:Integer=32bits
-2147483648 < Result Data)
C: Clear Input/Output box
=: Evaluate and display
BS: Back space
0x: for HEX
P: Math.pow( for Math.pow(n,m)
S: Math.sqrt( for Math.sqrt(n)
h: prev. input history buffer
v: next. input history buffer
Input box color 2 button:
right:expand width (input box)
left: expand line (input box)
Box Double click-->mobile size
Output box color 2 button:
right:expand width (output box)
left: expand line (output box)
Box Double click-->mobile size
(changed by Safari 5-->invalid)

<< If you reuse a source >>

Delete the following code,
when you reuse a source code.
1).Google AdSense Code
It exists after the header of
this file. (javascript * 2)
2).Provider Code
It exists in the end of
this file.
(from javascript before /body)


inserted by FC2 system