Overview
~~~~~~~~
This calculator is designed to evaluate expressions in the syntax of programming languages, such as C++, Assembler, Pascal.
Also, calculator is simple and easy tool to perform arithmetic and trigonometric operations.
Result of operations is shown in three basic number systems: DEC, HEX, BIN. Calculator has syntax highlighting,
clipboard copy/paste, history, type conversions and much more.

Perform calculations
~~~~~~~~~~~~~~~~~~~~
Enter an expression, such as "2+2*2", "2sin30". The result may be the following lines:
  NaN - Not-a-Number, for example, evaluates the expression "0/0";
 +INT - Plus infinity, for example, "2/0";
 -INT - Minus infinity, for example, "-2/0";

Operands
~~~~~~~~
As operands you can use any of the expressions:
 [sign][digits][d] 							- integer, for example, "-12345", "0123d";
 [sign][digits][.digits][e|E][sign][digits]	- floating-point number, for example, "-123.45", "1e-2";
 [sign][0x|x|$][digits|A-F][h] 				- hexadecimal notation, for example, "0xFF", "xAA", "$5555", "123h";
 [sign][0-1]b 								- binary notation, for example, "10101b";
 [sign]0[digits][o]							- octal notation, for example, "077";
 [sign]'[symbols]' 							- string, for example, "'ABC'";

Operators
~~~~~~~~~
Operators can be represented in the form of symbols and their equivalents literal representations. Valid operators are highlighted
blue. The table below shows the operators in order of priority in the calculation:

 ()				- brackets					2+2(1+1)
 ~,not			- bitwise NOT				~1
 -,neg			- unary minus				-1
 @				- bitmask					@4
 #				- ASCII code				#49
 ^,`,**,pow		- power						2**2
 *				- multiplication			2*2
 /				- division					10/5
 \,div			- integer division			10\5
 %,mod,rem		- modulo					15%10
 %%,percent		- percentage				150%10
 +				- addition					2+2
 -				- subtraction				10-5
 <<,shl			- bitwise left shift		1<<2
 >>,shr			- bitwise right shift		100b>>2
 &,and			- bitwise AND				3&1
 ^,xor			- bitwise XOR				2^3			(++ Syntax)
 |,or			- bitwise OR				1|2

Functions
~~~~~~~~~
Functions can take as a parameter as one operand, and the group in brackets. For example, "sin30", "sin(30+1)".
The table below in alphabetical order of names of functions:

 abs					- absolute value;
 acos,arccos			- arccosine;
 asin,arcsin			- arcsine;
 acot,actg,arccot,arcctg- arccotangent;
 atan,atg,arctan,arctg	- arctangent;
 ceil					- the smallest integer not less than parameter;
 chr					- the character for a specified ASCII value;
 cos					- cosine;
 ctg,cot				- cotangent;
 deg					- translate radians to degrees;
 exp					- exponential function;
 floor					- the largest integer not greater than parameter;
 frac					- fractional part;
 log,lg					- common logarithm;
 lb						- binary logarithm;
 ln						- natural logarithm;
 bit					- bitmask;
 rad					- translate degrees to radians;
 round					- round to integer;
 sin					- sine;
 sqr					- square;
 sqrt					- square root;
 tan,tg					- tangent;
 trunc					- truncate floating-point number;

Constants
~~~~~~~~~
 PI						3.14159265358979
 KBIT					128
 MBIT					131072
 GBIT					134217728
 KBYTE					1024
 MBYTE					1048576
 GBYTE					1073741824
 INT_MAX,MAXINT			9223372036854775807		(depends on the type and size of the data)
 INT_MIN,MININT			-9223372036854775808	(depends on the type and size of the data)
 UINT_MAX,MAXQWORD		18446744073709551615
 UINT_MAX,MAXDWORD		4294967295
 CHAR_MAX,MAXCHAR		127
 CHAR_MIN,MINCHAR		-128
 UCHAR_MAX,MAXBYTE		255
 SHRT_MAX,MAXSHORT		32767
 SHRT_MIN,MINSHORT		-32768
 USHRT_MAX,MAXWORD		65535
 LONG_MAX,MAXLONG		2147483647
 LONG_MIN,MINLONG		-2147483648
 ULONG_MAX,MAXDWORD		4294967295

Casting result
~~~~~~~~~~~~~~
To bring the results to the data type must be at the end of the expression to put the ":" and write the desired type. For example, "xFF:char".
The list of types is presented in tabular form:

 c,char,i8				- 8 bit signed		-128..127
 b,uchar,byte,u8,db		- 8 bit unsigned	0..255
 h,short,small,i16		- 16 bit signed		-32768..32767
 w,word,u16,dw			- 16 bit unsigned	0..65535
 l,long,i32				- 32 bit signed		-2147483648..2147483647
 g,u32,dword,dd 		- 32 bit unsigned	0..4294967295
 i,d,int,i64			- 64 bit signed		-9223372036854775808..9223372036854775807
 u,uint,u64,qword,dq    - 64 bit unsigned	0..18446744073709551615
 f,e,float				- floating-poing	2.2x10^-308..1.7x10^308
 s,str					- 8 character string

Shortcuts
~~~~~~~~~
 
 Ctrl-Ins,Ctrl-C		- copy of expression to the clipboard;
 Shift-Ins,Ctrl-V		- paste expression from the clipboard;
 Ctrl-E					- history;
 Ctrl-B,Ctrl-(,Ctrl-)	- put expression in brackets;

Donations
~~~~~~~~~
If you like the program, then support the author a small donation:

WebMoney:		R484184875068
				U138262260336
				Z084435415720

YandexMoney:	4100111980286


Author
~~~~~~
Shpilkin Dmitry
http://en.longsoft.su
2010