tkalc is a nifty pocket calculator for developers and IP network operators.
Arbitrary arithmetic and logical expressions can be entered very quickly in a text entry field. The result is then simultaneously displayed in
- decimal
- hexadecimal
- octal
- binary
- ASCII
- IP-Address
- boolean
The following things can be looked up in the online help:
Valid numbers are:
Description Example Decimal 42 Float 34.235 Scientific 45.12e5 Hex 0xdeadbeef Octal 0774 (leading zero) Binary [bin 1000.1111] (place dots at will) IP address [ip 192.168.41.1]
Operators from highest to lowest precedence:
* ~ ! Unary minus, bitwise NOT, logical NOT
* / % Multiply, divide, remainder
+ - Add, subtract
<< Left shift
>> Right shift
< > <= >= Less, greater, less or equal,
greater or equal
== != Equal, not equal
& Bitwise AND
^ Bitwise XOR
| Bitwise OR
&& Logical AND
|| Logical OR
x?y:z If x then y else z
Available functions are:
acos(x)
asin(x)
atan(x)
atan2(y,x)
ceil(x)
cos(x)
cosh(x)
exp(x)
floor(x)
fmod(x,y)
hypot(x,y)
log(x)
log10(x)
pow(x,y)
sin(x)
sinh(x)
sqrt(x)
tan(x)
tanh(x)
abs(x)
double(x)
int(x)
round(x)
rand()
srand(x)
