|
DualTypeCalc™ (of the Calcuverter tab) is a scientific calculator and therefore adheres to the common rules that power binds stronger than multiplication which binds stronger than addition aso.
![](images/DualTypeCalc.en.jpg)
The general properties are described under Calcuverter. Please make sure you have read this page.
To increase the precision you can choose your number base (the data type) in which the calculation should be done:
- 10: Choose this calculation as you primary choice since the world's numbers are usually decimal. It uses the .NET Framework's data type Decimal which is a double precision, exponential data type. This means that it can represent real world numbers totally exact up to quite big numbers, about 1028. This type avoids typical rounding errors that can occur in 2-based number systems, so it's especially valuable for money calculations.
-
2: Scientific calculations must be quick and with huge numbers. They are how computers think and therefore digital. For boolean logic it's a good choice but it's not fully precise at real world data. Such calculations will use the .NET Framework's Double data type, also a double precision exponential data type, and its maximum is much higher here, it goes up to 10308.
Be aware that both data types are exponential (for example you can write 1e10) and therefore will loose more and more precision the higher the numbers will get.
A unique feature of DualTypeCalc™ is that it can convert between these two data types on the fly. If a result becomes too large or a mathematical function is not supported by the current type, it is automatically converted to the other type. So that this has to be done as rarely as possible, DualTypeCalc™ has also additionally built in the decimal versions of functions such as 'Pow', 'Sin(x)', etc. These variants, normally only available for 'Double', increase the precision almost to double. If it nevertheless had to be changed into the other type, you get a warning triangle directly beside the result, since this possibly goes along with a reduction of the precision. You can also disable this automatic conversion and limit the calculation to a single type. The results of the calculation can be displayed rounded to a specified number of digits, and the formatting can be completely user-defined. Thus, it also has its value as a tool in the arsenal of any programmer who programs based on the .NET Framework.
One more feature to mention: DualTypeCalc™ can process numbers given in any regional format of the world. For example if you browse an online shop of another country you can easily copy & paste prices without having to edit them before usage.
DualTypeCalc™ is not only a formula calculator but it's also a hex and boolean calculator (functions NOT, AND, OR, XOR, >> and <<). It can calculate up to 64 bit wide expressions. Any number that takes part in an expression can be written either in decimal, hex (0xABCD, $CD) or binary (%101001). Additionally, the integer part is displayed in hex and binary, even if the result is outside the 64-bit range (also negative). You can copy the result to the clipboard in different formats and choose the number of digits you would like to see. Hex results can be chosen to be in lower- or uppercase characters.
There are two unique functions invented only for DualTypeCalc™: "4% of 283" and "Percent(x, y)". The first one should be self explanatory. The 'Percent' function calculates the percentage difference between two numbers and can also be written as "x -> y". Example: "100 -> 110" will say "110%". Finally, just writing a percentage, eg. "12%", will translate to "0.12" and can be used as such as a part of a complex expression.
Degree values are supported and can be specified in Degrees, Radians and Gradians and also in nautical form like 10° 20' 30" (degrees-minutes-seconds).
Some additional functions are embedded: Binomial coefficient (Ncr), Number permutation (Npr), Remainder , IEEERemainder, OLE Automation Currency (From/ToOACurrency) as well as minimum, maximum and average (Avg) of multiple arguments (eg. Min(a, b, c)). Random values can be generated by "RND()" and "RND(x)" and faculty with "Fac(x)" or "x!".
For constants DualTypeCalc™ has some addons ready to use: Pi and Euler's e is standard (you can also use the symbol π ) but it knows also the programmer's daily stuff like 'IntMax' (32-bit integer maximum), 'LongMax', 'DecimalMax' aso. Same with minimums. And it knows postfixes like "1G" (1 Giga) and the whole palette, and also in symbol form, for example "1µ".
Two Numbers button: DualTypeCalc™ has an ace up its sleeve for web pages: If there is a calculation specified like "......60.....$22..." (a number of units and a monetary amount embedded in any other text), it extracts the first and last numbers and then uses them to calculate the formula specified in the Two-Number Formula field. By default, the unit price formula is set to "{1} / {0}", or in other words, it divides the amount of money by the number of units (in the example $22 / 60 = $0.37). This is very useful if you are in an online store and want to quickly calculate the unit price of an item. Simply tick the checkbox "On Copy" in the "Two Numbers" button, switch to the online store and copy the description of the item to the clipboard. An additional flexibility: If the currency symbol is to the left or right of the first number (possibly with a space in between), the values will be swapped so that "{1}" always gets assigned the monetary amount. If there is no currency symbol, the last number is taken as the money amount. See Currency Converter for the list of recognized currencies. The free specification of the formula makes this very flexible. For example, you can also use the formula "{1} * {0}" to make a total amount calculation, so in the example 60 items at $22 each cost $1320. One can imagine even more applications.
Average button: If 'Calculation' is a multiline text where the first number on the line is the number of units and the last number the unit price, the average price of all lines is calculated. For example the lines '10...$20...' and '6...$30...' will produce the formula '((10*20)+(6*30))/16' = 23.75. As an optimization the two numbers can also occur the other way around. They will automatically be swapped so the currency is always on the right. See Currency Converter for the list of recognized currencies. This function is often used for copied text from a spreadsheet app.
To be highly compatible with other systems DualTypeCalc™ understands multiple flavors how functions are written:
Sqr = Sqrt, Rot = Root, Int = Floor, Ceil = Ceiling, Trunc = Truncate, Sgn = Sign, Fac = !, AND = &, OR = |, NOT = ~, Pow = ^
Variables
DualTypeCalc™ does also support variables. You can store the results of your calculations or constants by writing "MyVariable = SomeExpression". The variables will show up in the list on the right, where you can insert them at the cursor by double clicking. The variable '@' can be used to always access the result of the previous calculation and you can also select and copy text from the 'Log' panel where all previous calculations are logged. Assignments leave '@' untouched. All your variables including '@' will be saved when you exit Mighty Desktop.
Scripts
DualTypeCalc™ can process multiple lines with multiple statements in them, separated by ';'. Arguments of functions are separated by ','. Use Ctrl-Enter to insert a line break. These so called `Scripts` allow to parameterize complicated functions easily. Here is the example of the famous Pythagoras Hypotenuse Calculation:
a = 10;
b = 20;
c = SQR(a^2 + b^2);
There are some predefined variables that can be used to change calculation settings (only assignment supported):
Additional infos:
- Function arguments are separated by ',' and statements by ';'. In cultures that use ',' as a decimal point in numbers (eg. Germany), function arguments must be separated by ';' and statements by '§' (evasion).
- Characters like ''¼", "½" and "¾" are supported
- Appendixes like "m" (milli), "µ" (micro, Alt-0181), "n" (nano), "p" (pico), "k" (kilo), "M" (mega), "G" (giga), "T" (tera), "P" (peta), "X" (exa), "Z" (zeta) , "Y" (yota) , "R" (ronna) or "Q" (quetta) for powers of 10
- 'DIV' and 'MOD' are the rounded integer number division operators
- 'Min', 'Max' and 'Avg' can have any number of arguments (eg. Avg(a, b, c, ..))
- 'FromOACurrency' and 'ToOACurrency': These values are used in Microsoft Office® Automation for OLE objects
- "x% of y" binds stronger than any other operation like addition, multiplication, power aso.
- "x >> y" binds the weakest, same strength as "<<" and "->"
- Hex and binary representations are provided up to any size of number, therefor not limited to 64 bit or similar. Also negative numbers are supported, eg. "-1" results in "F" hex.
- Formula parts can also be inserted at cursor position into the expression by double-clicking in the list on the right
- Clear a variable by "Variable ="
- You have a wide range of options for formatting the result (amount of digits, thousands separators aso.)
- You don't have to reformat a foreign country's numbers that don't match your current regional number format, such as when you are on a website. Just change the combo box to the number format of the website.
- You can swap the left and right part of a simple expression like "123 / 456" by a single click.
Here is a list of many examples.
Notes:
- You can switch quickly to DualTypeCalc™ by pressing RightCtrl-C from any other application (see Hotkeys).
- If "On Copy" is checked , you can bypass automatic processing by holding down a key such as [Alt], [Ctrl], or [Shift] while copying.
|