Two Hoots Banner



Javascript to build scientific calculator
Advanced Scientific Calculator
 
 
 
 
             
 
 
 
This scientific calculator is built using HTML tables. The majority of the buttons when clicked simply add the entered number to the input box.
So for example hitting the 1 button performs the onClick function onClick="form.input.value += '1'". Hitting any of the function buttons causes their respective Javascript functions to be called as below.

function doit() {
form.input.value = eval(form.input.value)
}

function Cos() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.cos(x);
}

function Sin() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.sin(x);
}

function Ln() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.log(x);
}

function Root() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.sqrt(x);
}

function Tan() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.tan(x);
}

function Icos() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.acos(x);
}

function Isin() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.asin(x);
}

function Itan() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.atan(x);
}

function Round() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.round(x);
}

function Ran() {
x = form.input.value
form.input.value = Math.random(x);
}

function Neg () {
x = form.input.value
if (x == '') alert('Error: Input Required');
else x = parseFloat(x) * -1;
}

function del() {
x = form.input.value
x = (x.substring) - 1
}
Free JavaScripts provided by
The JavaScript Source