Back to Calculator


Key Functions- Divison Tests- Download- Email-

Intro:


IMPORTANT NOTE: AlpMcalc is a rules based calculator. This means that it uses no internal math methods. The calculations are based solely on math rules and code logic. While a lot of testing has been done it is possible to encounter certain problems with results. The base methods of Addition and subtraction have been bug free for over two years. For the most current release with bug fixes visit the download site below. It can also be used as a tool for code logic flow and obviously a good mathmatical tool. One last comment is that the speed is constantly being improved but this type of calculator can never be as fast as one that uses code dependant math libraries.

AlpMcalc is a 'NO number' calculator. It uses A-J alpha matrixes to compute my own coded math methods and it does it without using numbers or any Math functions built into JavaScript. The only numbers used are for indexing and comparison. The matrix components and index references does it all. After you click = the interface turns the numbers into letters a-j, computes, and then converts back to numbers to present solution. Only your CPU and memory limit the length of integers.

The interface is made so as to mimic a normal calculator. DO NOT enter digits with keyboard; only enter by clicking on keys with mouse. The interface is designed to dynamically update display and input fields by clicking on the appropriate numbers and functions.

CE will clear all input fields except memory, click CM to clear memory. C will clear what was entered in display field. BK will delete last digit entered. Reloading page will not clear input fields you must click CE or CM to clear input fields.

This version has been tested in IE 6, NS 7, and FireFox 1.0.6 and presently has 9 functions; Division, multiplication, addition, subtraction, digital root, powers, LCD, LCM, and GCD.

Key functions and special keys are as follows:

Standard- This is the default mode. You can enter fractions in this mode.
Decimal- Click this button to enter decimal mode. All answers will be given in decimal form. The default # of places to the right is 5. You can increase this by clicking on the Decimal mode indicator in the lower right corner of the calculator just before you click the = button. You can only do this in decimal mode and it will go back to default after the calculation. The more places you set it for the longer it will take. There is no maximum so consider it before you set it to a high amount. Only set this just before you click the = or the var resets will take it back down to 5.
. - To Place a decimal. You must be in decimal mode.
MR - Memory recall
M+ - Add what is in display to memory
M- - Subtract what is in display from memory
CE - Clears all input fields(clean slate)except memory. Clicking this in the middle of entering numbers will cause previously entered numbers to be cleared. Only use this key to start from beginning.
C - Clears what is entered in display
BK - Deletes last digit entered
CM - Clears Memory
/ - Division; on dividing a smaller whole number by a larger whole number the answer will always be a fraction using yhose two numbers ( 27 divided by 45 the correct answer is 27/45; etc.) when I add a decimal mode it will be possiable to drill down to a more precise number. With LCD on it will simplify the fraction.
x - Multiplication
+ - Addition
- - Subtraction
+/- - Makes number negative or positive
= - This calls the math function - After clicking this key the display under the calculator will indicate it is working and when it is complete the answer will be shown in display. In the case of division if there is a remainder it will be shown in the tan window at the bottom of the calculator.
^ - This is a Powers function, On powers Base is entered first.10^300; you enter 10 click ^ , enter 300, and click the = key. The fraction mode is working now but is somewhat slow.
DR - DR will give the digital root of a number, just enter number and click the DR key
GCD - GCD Greatest Common Denominator, enter first number click gcd key enter second number click gcd key again. Answer will be returned in display. Entering high primes which are multibles of high primes will take a long time to solve but it will solve.
f/ - Fraction mode, click this button before you enter a fraction; click again before you enter denominator. You can enter mixed numbers; just enter whole number, then click the f/ button, enter first part of fraction then click f/ again and enter last part of fraction. The fraction part of the solution will be given in 'simple form' if LCD is on. See LCD for more info. The F/ key only affects the formatting and display of numbers entered. If you enter a number and decide you entered it incorrectly, before you click a function key, click the C key and enter again.
LCM - Least common multiple of two numbers. Enter first number, click LCM, enter second number, and click LCM again. Solution will be shown in display.
LCD - Lowest Common Divisor of two numbers, NOTE: If you click LCD and no prompt appears click again. Some browsers will block the popup the first time and may ask you to confirm or allow first. PLEASE BE AWARE - When LCD is on it is possible to arrive at or enter numbers that will take a long time to compute. I've tested this with several prime and non-prime numbers and multiples of each and most all were fairly quick. (Unless both numbers entered are prime) This is based on the premise that if there is no GCD (Greatest Common Denominator) there is no LCD. It also works on the fact that if there is a GCD the LCD will be lower or equal to GCD and will not try calculations above the GCD. The code starts at 2 and goes up to the GCD until it finds a common divisor so the first it finds will be the lowest. With some numbers it may take a while to compute and with very long numbers it may be too long to be practical. This is why I decided to make this a special option and give the user the opportunity to decide how many attempts to try. For normal calculations it should not be a huge issue but if LCD is on and you set the number of tries high it might take a while. I wouldn't set number above 1000 unless you are sure of what your doing. A common number to set the max tries is 100. To turn LCD on click the LCD above the division button, you will be asked to set the max tries, enter the number and click OK, the GCD button will change to LCD. While this button displays LCD you are in LCD mode. Just enter first number, click LCD button, enter second number, and click LCD again, the answer will be shown in display. For fraction mode if you want the fraction part of the solution to be in 'simple form' select this option and set max tries to 100; or more if you understand on hard numbers it may take a while. To find LCD of a single number enter same number twice. Entering high primes which are multibles of high primes will take a long time to solve but it will solve, when doing this never set max tries abovesq root of the sum of the number you are testing. This method can determine if a number is prime without checking a known prime list and for unknown primes, and a lot of known primes, it would need a really powerful CPU, do they even make one?, to make the wait practical(See update below on using the ?/P function for this). This is a good place to explain that AlpMcalc will take longer to determine if number is prime then other methods but AlpMcalc will also handle any lenghth number. Because I don't use JS math methods I can calculate very long numbers. If I were limited to the internal JS methods it would be impossible to do long calculations. I use a hard method to arrive at solutions so the time to compute will take a longer time. I'm working on a solution that will greatly reduce the time using the hard math method but the bottom line is you have to do the math to return the correct answer when calculating long numbers so I do the math with all entries. To quit LCD mode just click the LCD above the Division button, after a calculation, and the LCD button will change back to GCD. NOTE: If you enter or check for primes use the ?/P. It will use the internal rules and return a lot quicker. Using lcd on large primes (over 6 digits) will take a long time to compute because it will use hard math. See updates below on LCD and ?/P


Math Division Tests Keys:

The math division section tests for division by the number on the key. You enter a number and click the division key of the divisor you want to test. After it is complete a true(number is divisible by) or false (number is not divisible by) will be shown in the bottom window of the math division tests section. This can be a quick way of checking divisibility of long numbers before doing the division.

?/p - Tests for division of a number by any prime over 11. This function uses an advanced check to guess if a number is prime but it expects you to enter a prime. Entering a number and then entering a non-prime divisor may give an incorrect response. To use this function enter a number of any size and click the ?/p key, then enter a known prime and click the ?/p key again. While it is working it will display 'working....' in the bottom window of the math division tests section. After it is complete a true(number is divisible by) or false (number is not divisible by) will be shown in the bottom window of the math division tests section. This can also guess if the number you entered as prime is prime. To use this as a prime check just enter any number, click ?/P, enter thr number to check for prime, click ?/P again. If it is not a possible prime it will let you know, otherwise it will simply run the calculation. See updates below.

Version and updates history:

Version 2 -(10-10-05) added negative integer capability, corrected some division issues, added some math division test functions, added an entry backup key, added a clear key, fixed the clear everything key to clear all input fields except memory, and did a general tune-up to speed the processes- especially division. Updated interface for new keys and to load faster. Created this help file. Added GCD function (Greatest Common Denominator between two numbers) and fixed a bug were a zero was added to solution when the backwards div was looking at a single digit remainder and it was less then the stripped down number being divided and both were only one digit, this only was happening in rare cases.

Update 11-7-05.Was still adding a zero to solution in rare cases. I made another adjustment to correct that seems to have fixed it. This was happening when the solution was reached before the code completed a full itineration. I corrected by having it check that we were still looking at a complete divisor before we added the zero for digit jump in backward dividing. Just as a note here a backward division goes something like this:
50990/944
First we add zeros to the divisor without going over the number we are dividing. In this case:
50990/9440
We then divide and keep the remainder while remembering the product. In this case 5. We then back down the added zero on the divisor and divide again to a product of 4 that we add to the 5 we got earlier to get 54. Since the remainder at this point is 14 (less then the divisor) we stop and have an answer to 50990/944 of 54 with a remainder of 14. If the problem were 680997/54 we would start with 680997/540000 and use the same process. The code has to look for digit jumps that mean the product contains one or more jumps from one to tens, or tens to hundreds, etc.... An example would be 98592/96. We would use 98592/96000. That product is 1 with a remainder of 2592. If we back down on the divisor we have 2592/9600 so we know we jumped a digit place and add a zero to the product and back down the divisor again. Now our product is 10 and the new remaining problem is 2592/960. that product is 2, which we add to the 10 we remembered so now we have 102 and a new problem of 672/96, which is 7. So we add that to the product and get 1027. Since there was no remainder we stop and we have a solution to 98592/96 of 1027 with no remainder. This may seem a little out there but because I'm using no numbers in the actual calculations and functions it makes the process quicker on long calculations of like a hundred or more digits divided by small divisors.
Hope that helps.

2/2006 - Created smaller version to fit on screens at lower resolutions and screen sizes.Fixed math div test on 6. Miss-named var and var value change in call to second function fixed. Added fraction mode so fractions and mixed numbers could be calculated, added LCD (Lowest Common Divisor), and LCM (Lowest Common Multiple),


Version 3 -(2-14-06) added fraction mode, which allows the entering of fractions and mixed numbers in math calculations. The calculator gives the user the choice to present solution in "simple fraction" form by using the new LCD mode/function. Added LCD mode/function, which allows computing of Lowest Common Divisor of two numbers or the lower of one number(the lowest number that any given number can be divided by - except 1 unless that is the only divisor). In the case of GCD if you enter the same number twice it will always be that number. It needs to be this way because of its use by the other functions (this would be the correct answer). I plan to add another function, which will allow a solution for getting a highest divisor for one number other than itself. The methods are already in place I just have to find room for the button. I also added an LCM (Lowest Common Multiple of two numbers)function. I did some more general tuning and re-arranged some of the keys and also added a trip link for the LCD mode. I also combined the js files for the change size option. This allowed both html files (small size or large size) to use the same js files. Added some user error protection in the entering of problems. Removed the add largest number first from all the functions that still had it.
The calculator now has 9 functions - Division, Times, Subtraction, Addition, Digital Root, Powers, LCD, GCD, and LCM, and 9 test functions for a total of 18 functions. AlpMcalc still uses my own coded math methods and no numbers in the actual calculations. No JS math methods are used in the calculator.


2/20/06 Fixed memory to accept fractions. Added more info to this help file. Fixed POW function to work with fractions, still need to look at improving speed a little here. 2/23/06 Did saome housekeeping with the JS files. I'm at 3500 lines of code.


3/22/06 - Changed Alpmcalc over to CSS. I was having a few issues with the images so I decided to just do away with them. So we no longer need the smaller size as the css version will work on all resolutions from 800 on up. It's a little tight on 640 but still ok. No images will be included in future zip versions.

3/28/-06 - Added decimal mode. The default is 5 digits to the right.
I also corrected some major issues that were a result of my trimmimg the code.



4/2/-06 - Added decimalmode use of the powers and memory functions.
I also corrected some issues with decimalmode. Also added some more user error protection.I will be testing this release and fixing any issues I discover as I go.

4/28/06 - Corrected an issue with the memory function that wasn't working with standard numbers. This broke when I added the function ability for adding and subtracting decimals and fractions in memory. It worked for those but would'nt for standard numbers. Now it works for all number types. It will not accept deciamals if a fraction is in memory and vice-versa. I'm working on a conversion process that will allow deciamal and fraction interaction in all the calculator functions.

9/8/06 - Corrected issues with ?/P function. Added an advanced check to look at entered prime. If number is not prime it will complain. This check is not the best check for prime but it uses a rhythm to decide if number is possibly a prime instead of checking a list. This works great for the first few million or so of primes but it needs further checking to see how high the test will go and remain accurate. This was put in as a test for prime and speed was a concern so I only allowed the code to go so far. If you want to test this on really large numbers and you are familiar with code: in divtests.js change the line maxtrys=1000 to maxtrys=?????? -what ever number you are comfortable with. Large values will cause your system to run slow. Just kill the process if you need to. You can set your browser to not complain about the process just email me.

At this time all functions seem to be working properly but if I uncover a problem I'll correct it and keep the copy on my site updated.

10/31/06 - Corrected a decimal issue and sharpen the lcd feature. Now the lcd will go to the sq root. If a 1 or the number you entered is returned there is no lcd other then 1 or the number. Entering the same prime twice on lcd may take a long time but in principal will verify if it is prime. I also added another check to the ?/p function that will try to guess if the p is prime. This not real accurate but is a good guess.

7/30/06 - Corrected a decimal issue in times mode. I need to keep looking at decimal issues.



Please report bugs to email address below.

You can email me at webadmin@jbatkins.com.


This program is copyright protected 2005 and contains methods that are the intellectual property of the author. Feel free to use and distribute as long as program is not altered in any way and copyright statement is included. For commercial use please contact author.

To download a zip version of this program click here

© 2005 Jim Atkins