Back to Calculator


Key Functions- Divison Tests- Download-

Intro:

IMPORTANT NOTE:
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.
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.\

Key functions and special keys are as follows:

Decimal- Except for simple adding and subtracting of whole numbers 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 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.
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 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.
^ - 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.


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 

http://www.jbatkins.com/contact 

© 2005 Jim Atkins JBAtkins Consulting