This project aims at implementing math theory algorithms in JavaScript. Copyright 2014 Usmar Padow (amigojapan) usmpadow@gmail.com , Patrick Robotham and Greg Cox

You should view the source to see the source code of how these functions where implemented. to do this either click on View source on your browser or click here
input1:
count program withought using the + operator. based on Pre-Algebra 2 - Roman Numerals: Sign-Value versus Positional Notation anything between spaces represents an object, here Os represent coconuts. First enter the number of coconuts you want into input1 (can only count from 0 to 9)
Note:Coconuts must be seperated by spaces... do not include extra spaces, or spaces at the end

Count up to 99 coconuts First enter the number of coconuts you want into input2 (can only count from 0 to 9)
input2:


Count as many coconuts as you like!
Input 3:


Now we will do addition by simply concatenating the coconuts from one text field to the ones of another(notice that this plus sign is concatenation and not addition(which means it is more like saying "this pile of coconuts AND this pile of coconuts, lets count them both"
A =
B =

Now that we have implemented addition, I think we can allow ourselves to use the regular + operator.

Now we will do subtraction by counting the number of coconuts in Y and then poping off that amount of coconuts from the array generated from X , then counting X.
X =
Y =


Multiplication is done by adding something a certain amount of times, for example, if we do 3X2 we will add 3 to 3 (or add 3 two times):
Mul1 =
Mul2 =

Now we can allow ourselves to use the * multiplication operator.
Integer division is done by counting how many times we had to subtract a number to get it to become another number,
For example 5 divided by 2 we do 5 - 2 - 2 (or substract 2 two times) the result of 5-2-2 is 4 which can no which if we substract it again it will be less than 0, do we take the left over 1, this is called the remainder:
In the expression c = a / b, a is called the dividend or numerator, b the divisor or denominator and the result c is called the quotient.
it is also noteworthy to mention that like subtraction is the opposite of addition, division is also the opposite of multiplication.
Numerator =
Denominator =

Now we can allow ourselves to use the / division operator for integer parameters and floor it (so that the result is an integer).
We can also allow ourselves to use the % modulus operator, because the remainder is the result of that operator.


Fractions

Object to store mixed fractions
The following scripts are based on teh formulas on this page
A Mixed fraction is a fraction which has a part with whole numbers and a part with the fractional portion (numerator over denominator)
One operation we can do with fractions is convert them from mixed fractions to non mixed fractions, lets do that:
For example 1 whole and one half is 3 halfs...
MixedWholes =
MixedNumerator =
MixedDenominator =


Simplifying fractions. In many cases, a fraction can represent the same number as a simpler fraction, here is how to do it:
For example 20/2 in it simplest form is 10/1.
ComplexNumerator =
ComplexDenominator =



Next lets do addition, subtraction, multiplication and division and test for fraction equivalence of fractions:
Fraction A:
NumeratorA =
DenominatorA =
Fraction B:
NumeratorB =
DenominatorB =








This function is nessesary because sometimes fractions may appear to be different but may be actually the same value
For example 10/20 is equivalent to 1/2



***I leave the task of doing powers of fractions to someone else, please email me the answer to usmpadow@gmail.com


"Power of" function(We are implementing this function because i is nessesary in the Floating point division operation.)
Exponent =
Number =


Now we can us the Math.pow() function in the following scripts.

*** < operators should be implemented because it is necessary for Floating point division.
Number1 =
Number2 =


Floating point division, with precision parameter
FPNumerator =
FPDenominator =
precision =

Now we can allow ourselves to use the / operator on floating point numbers
Maximum Number =