^ back to top
Download
Calc SS3
Google Chrome™ Edition
Calc SS3 can be installed directly from Google or from the Google Chrome web store:
See http://dematte.at/CalcSS3 for a clean and nice 1-file demo of Calc SS3
^ back to top
Features
- Uses no memory if not in use, so don't bother having Calc SS3 installed
(most extensions use memory just by running in the background and slow down your Google Chrome™ browser and make it 'heavy')
- Uses very little memory if in use (no images, event delegation,...)
- Frees all the memory if 'turned off'
- Memorizes not only the display if turned off/on but also all other states.
It's even possible to continue a calculation sequence after turning it off/on
- Full Keyboard support: See Using the Calculator
- Copy/Paste from/to display with Ctrl+C and Ctrl+V
- Digit grouping in 4 modes: [1 234.5], [1 234,5], [1,234.5] or [1.234,5] switchable with the new circle on the left or [h, Shift+G]
- Dynamic font-size in display to keep numbers as readable as possible.
- Simple / Scientific toggle: click arrow in a circle on left side of display or
doubleclick display or press [TAB] to toggle. All keybord shortcuts work in both modes!
- Real sci-calc-style calculations, so 1+2*3=7 (... not 9 like with others),
and 1*(2+3)=5=25 (... not 8 like with the original iPhone™ calculator)
- You can theoretically use an unlimited amount of brackets
- No need to close brackets if equation sign follows anyhow
- Look and feel of the well known iPhone™ (OS4) calculator
Mouse handling mimics the handling of the iPhone™
^ back to top
About Precision
This calculator operates with a precision of (only) 15 digits after the decimal point. This is due to a 'problem' with how JavaScript handles floating point numbers.
This isn't actually a Javascript feature but a feature of the way the IEEE define how floating point numbers are stored in memory. Any language using this definition suffers from this 'feature', for instance C does as well and since JavaScript is often implemented in C so does JavaScript.
The problem is that Javascript is using 32 bits of data which have 4294967296 different combinations to hold any value in the range 1.7976931348623158e+308 to 2.2250738585072014e–308.
It does this by using a smaller presision value and using some of the bits as a exponent (this can also be done in 16 bits with a smaller range and less presision) which results in it being able to approximate any value in the range but not exactly represent them all (because in real number terms the are an infinaite number of values between any 2 given values).
As part of your calculcation clearly the internal representation of the value is going outside the available presision and you are ending up with an approximation to the value instead of an exact value.
See following links that explain this situation more precise:
Getting around this would mean to programm a high precission calculation engine which would slow down the calculations dramandously and blow up the script, or to send the calculations to an external calculator (as web services, Ajax request or so) which would aslo slow down the calculations and would make this calculator an 'online' programm, which you probably wouldn't want to have.
Most 'real' calculators as the TI-30X or the HP 12c have a 'displayed' precission of <= 10 digits (internal it's higher though) which relativizes this problem here anyhow...
Reducing the precission down to 15 digits solves some issues (people commonly like to point out) like:
0.1 + 0.2 = 0.30000000000000004 or
2.01 - 2 = 0.009999999999999787.
But there are still some calculations that are not precise enough for 15 digits after the decimal point:
15.99 + 1 = 16.990000000000002
I could reduce the accuracy down to 14 digits to avoid confusion, but... well.
^ back to top
Speed issues
This calculator's skin is made with DIVs and CSS3 only. Most of those StyleSheet commands take a longer time to be rendered in FireFox. This is a reason why the reaction time of the virtual key board and the input through the 'real' key board seems to be a little slow. Although not too slow so that I'd have to change the technology to something else like real images or realizing it with canvas or SVG.
This way it might be a little slow with some older computers or on FF but still very small and simple.
My intentions to program this were actually to practices CSS3 features and to be able to realize a draft.
See http://dematte.at/CalcSS3 for a clean, nice and even faster 1-file version of Calc SS3
^ back to top
iPhone calc issue(s)
The calculator of the iPhone (OS4) has some weird issues. One of them is the continuous equation calculation: So, if you type 1+1= you expect 2. If you hit = again it's 3, so the last operation (+1) is being continued. But, what if you do 2*(3+4)=... it's 14 and again =...
Well, in this case it doesn't make sense to see +4 as the last operation because it's part of a parentheses,
so, *(3+4) or better *7 would be the last operation which would (should) cause the result of 98 to be correct (=686=4802...).
The iPhone calc has two different (weird) results to offer, depending on closeing the last bracket or not:
2*(3+4)=14=21=28... and
2*(3+4 =14=18=22
This doesn't quite make sens!? In the first case you get the result of the parentheses, so 7 but with the wrong operand (+), the last one typed in... and in the second case you get the last operand and last number typed in as operand and value even though it's only a part of the parentheses.
Both results are not comprehensible and I'd say, incorrect.
The second obvious issue is x!
There is no factorial of floating point values... but with the iPhone calc there is...?
Calc SS3 rounds the input first to calculate with an integer.
There are some more issues with the iPhone calc, like the white ring around the 'mr' even though the result is 0 (so: mc 8 m+ m- causes the iPhone to still have the ring around 'mr' even though 'mr' returns zero), or the missing ring around the '(' when a parentheses is active, which is no bug but a missing feature,... but then, it has a higher precision then javaScript.^ back to top
Using the Calculator [version: 0.9.95]
Click on numbers and functions in Calculator just as you would with a standard calculator.
When you click the add, subtract, multiply, or divide button (in scientific mode also: yx, x√y, EE and the opened round bracket), a white ring appears around the button to let you know the operation to be carried out. The ring around the opened round bracket will stay until all parentheses expressions are closed.
This calculator uses an algebraic method of entry that allows you to enter mathematical sequences in the same order that they are algebraically stated (PEMDAS / AOS™).
PEMDAS: "Parentheses, Exponents, Multiplication or Division, and Addition or Subtraction". Multiplication and division have the same ranking. Addition and subtraction as well.
Hovering the ? symbol will bring up more options (> and .).
Switch between the 4 digit grouping modes (1 234.5), (1 234,5), (1,234.5) or (1.234,5) by clicking the circle on the left (showing the modes . , ,. or .,) or by typing [h, Shift+G]
Click on the > or < sign in the left side of the display, double-click the display or hit [TAB] to toggle between scientific and simple calculator.
Keyboard support
There is full keyboard support for each button on the calculator.
- The numbers and + – × ÷ , . = keys can also be input on number block.
- See below the keyboard short cuts of each calculator button in [brackets].
- Use the [Backspace] key to correct the last, single input number, point or +/- sign.
- All [ENTER] keys represent the '=' button.
- Hold key: [h, s] means: press h or H and you'll see a little 'hold' in the right bottom corner of the display.
This makes the followed key function different: [s] = sin, but [h, s] = sinh, etc.
- Copy/Paste from/to display with Ctrl+C and Ctrl+V.
- Tab key toggles the calculator from simple to scientific and backwards.
-
All those keyboard shortcuts can also be used in simple mode.
Standard Functions
-
[Del] Click to clear the displayed number. Removes an incorrect entry/number from the display when pressed before any function or operation key is pressed.
-
[Del] Click to clear the displayed number and the constant and pending operations.
-
[v] Click to clear the memory.
-
[b] Click to add the displayed number to the number in memory. If no number is in memory, click to store the displayed number in memory.
-
[n] Click to subtract the displayed number from the number in memory. If no number is in memory, click to store the displayed number as a subtraction of zero in memory.
-
[m] Click to replace the displayed number with the number in memory.
If the button has a white ring around it, there is a number stored in memory. The white ring around the button also disappears if the stored number calculates zero.
-
[#] Changes the algebraic sign
-
[ENTER] Finishes any function or operation and displays the result.
If there are any
unfinished parentheses expressions before this key is clicked or hit,
they get finished automaticaly.
2*(2+3*(2+4))=40 is the same as typing 2*(2+3*(2+4=40
The stored number, the display, all constant and pending operations and the key states remain in memory when you switch between the standard and scientific calculators and even if you turn the calculator 'off' by loosing focus of the app or hitting the 'Esc' key.
Scientific Calculator Keys
Click on the > or < sign in the left side of the display, double-click the display or hit [TAB] to toggle between scientific and simple calculator.
-
[Space] Changes the trigonometric buttons (sin, cos, tan, sinh, cosh, and tanh)
to their inverse functions (sin-1, cos-1, tan-1, sinh-1, cosh-1, and tanh-1). It also changes ln to log2,
and ex to 2x. Click 2nd again to return the buttons to their original functions.
-
[(] Opens a parenthetical expression. Expressions can be nested. Clicking on it lets a white ring appear around the button to let you know that a parenthetical expresion is still active (until all expressions are closed with the closeing bracket or the equation sign).
-
[)] Closes a parenthetical expression. The white ring around the ( bracket key will stay until all expressions are closed with this key or after clicking the equation sign.
-
[%] Calculates percentages, adds markups, and subtracts discounts. To calculate a percentage, use it with the +, –, × or ÷ keys. For example, to calculate 8% of 500, enter 500 x 8 % (no equation key (=)) which returns 40. To add a markup or subtract a discount, additionaly use the equation (=) key. For example, to compute the total cost of a $500 item with an 8% sales tax, enter 500 + 8 % = which returns 540.
-
[\ or h, 1] Returns the reciprocal of a value in decimal format.
-
[h, 2] Squares a value.
-
[h, 3] Cubes a value.
-
[^ or ' or "] Click between values to raise the first value to the power of the second value.
For example, to compute 34, enter 3 yx 4 = which returns 81.
-
[x] Calculates the factorial of a value (only integers).
-
[h, r] Calculates the square root of a value.
-
[r] Use between values to calculate the x root of y. For example to compute 4√81,
enter 81 x√y 4 = which returns 3.
-
[Shift+L] Returns the log base 10 of a value.
-
[s] Calculates the sine of a value.
-
[Shift+S] Calculates the arc sine of a value. (Available when the 2nd button is clicked.)
-
[c] Calculates the cosine of a value.
-
[Shift+C] Calculates the arc cosine of a value. (Available when the 2nd button is clicked.)
-
[t] Calculates the tangent of a value.
-
[Shift+T] Calculates the arc tangent of a value. (Available when the 2nd button is clicked.)
-
[l] Calculates the natural log of a value.
-
[h, l] Calculates the log base 2. (Available when the 2nd button is clicked.)
-
[h, s] Calculates the hyperbolic sine of a value.
-
[h, Shift+S] Calculates the inverse hyperbolic sine of a value. (Available when the 2nd button is clicked.)
-
[h, c] Calculates the hyperbolic cosine of a value.
-
[h, Shift+C] Calculates the inverse hyperbolic cosine of a value. (Available when the 2nd button is clicked.)
-
[h, t] Calculates the hyperbolic tangent of a value.
-
[h, Shift+T] Calculates the inverse hyperbolic tangent of a value. (Available when the 2nd button is clicked.)
-
[e] Click after entering a value to raise the constant 'e' (2.718281828459045…) to the power of that value.
-
[Shift+X or h, e] Calculates 2 to the power of the displayed value. For example, 10 2x = 1024. (Available when the 2nd button is clicked.)
-
[d or °] Changes the mode to express trigonometric functions in radians.
-
[d or °] Changes the mode to express trigonometric functions in degrees.
-
[p] Enters the value of PI or π (3.141592653589793…).
-
[Shift+E] An operator that multiplies the currently displayed value by 10 to the power of the next value you enter.
-
[h, n or h, d] Returns a random number between 0 and 1.
^ back to top