Maths: Remainders

Maths: Remainders

function Difference(){
 number1 = parseInt(document.getElementById('number1').options[document.getElementById('number1').selectedIndex].value
 number2 = parseInt(document.getElementById('number2').options[document.getElementById('number2').selectedIndex].value);
 division_result = Math.floor(number1/number2);
 difference = number1 % number2;
 document.getElementById('playingWithMaths').innerHTML = 'Result: '+division_result+ ' (Remainder '+ difference + ')';
}
Comments are closed.