LuaCalc
|
LuaCalc is a crossplatform calculator with very fast usage, it is based on preprocessor to Lua language (CLua).
Usage
1. Input
Type CLua code. For fast parenthesing - select text and press '('. Press 'Return' to commit expression to History.
2. Output
It's very simple. You type your expression in upper text form and take result from the lower text form. Result copies to clipboard by clicking result form. Result expression formats as CLua code, so you can use it directly in next expression.
3. Output filter
Buttons under the result text field controls output filter. Buttons with prefix 'x' (x2, x10, x16) controls number base, and buttons with brackets controls output size in bytes for integer values.
4. Error handling
Because it's a calculator based on script language - you can receive syntax or logic error from Lua or CLua compilator. If you write expression wrong, you will see red rectangle instead of green. Mouseover it to view tooltip with error message.
5. Window appearance
Button 'OnTop/' controls window 'Always on top' state and mouse scroll on it changes window alpha.
6. History
Button 'History' shows or hides history window that collects all expression that you committed by key 'Return" on your keypad. History also shows when 'Return' pressed. Doubleclick on string in history copies it's expression to edit form replacing old value. Mini scrollbar close to the error tracker can fast navigate through history by clicking or mousewheel.
7. Multiline edit
On the multiline tab you can write some CLua code and then use Ctrl+Return to commit it to Virtual Machine. This is fast way to define some functions or variables. You can fast switch between ML and SL view byt pressing Shift+Tab combination.
8. Syntax
CLua have a hybrid syntax between C-style and Lua.
9. Numbers
Use number prefix '0x' to type hex value (like 0xff).
Use prefix '0b' to type bin value.
10. Control statements
if( <expression> )
<statements>
end
for( <var_name> = <start_exp>, <end_exp> [, <step_exp>] )
<statements>
end
for( <var_name> [, <var_name> [, ...]] in <expression>[, <expression> [, ...]] )
<statements>
end
while( <expression> )
<statements>
end
repeat
<statements>
until( <expression> )
11. Functions
Definition:
[<function_name> = ] function( <param> [, <param> [, ...]] )
<statements>
end
Call:
{<function_name> | <function_definition>} ( <param> [, <param> [, ...]] )
12. Operators
Conditional:
<condition_exp> ? <on_true_exp> :: <on_false_exp>
13. Unary:
- <exp> - unary minus
! <exp> - logical not
~ <exp> - bitwise not
# <exp> - table or string length getter
14. Binary:
<exp> < <exp> - logical less
<exp> > <exp> - logical greater
<exp> == <exp> - equal
<exp> != <exp> - not equal
<exp> <= <exp> - less or equal
<exp> >= <exp> - greater or equal
<exp> && <exp> - logical and
<exp> || <exp> - logical or
<exp> ^^ <exp> - logical xor
<exp> << <exp> - left bit shift
<exp> >> <exp> - right bit shift
<exp> & <exp> - bitwise and
<exp> | <exp> - bitwise or
<exp> ^ <exp> - bitwise xor
<exp> + <exp> - addition
<exp> - <exp> - substraction
<exp> * <exp> - multiplication
<exp> / <exp> - division
<exp> % <exp> - remainder of division
<exp> .. <exp> - string concatinating
15. Built in functions
For looking of built in function list you may refer to Lua 5.1 manual page www.lua.org/manual/5.1/. Math functions to easy use was transfered from "math" namespace to global, so you can write expressions like cos(pi) directly.
The license of this software is Free, you can free download and free use this calculator software.