Hex Calculator
by Murphy O'Brien
05 Oct 2006
(Updated 10 Oct 2006)
Hex evaluation and calculator with logical and arithmetic operators
|
Watch this File
|
| File Information |
| Description |
Evaluates the input character string as a hexadecimal expression and returns both hex and decimal outputs.
Allowed operators in precedence order are:
#(xor) &(and) |(or) ^(exponential) /(divide) *(times) -(minus) +(plus)
[OUTH,OUTD]=HEXCALC(EXPR)
evaluate the input expression and return both hex and decimal outputs.
HEXCALC(EXPR) with no output arguments prints both outputs
example:
hexcalc('F4*4-34/2*4-640*3+a#F2+3|A0')
prints out:
evaluates as FFFFF243 hex or -3517 decimal |
| MATLAB release |
MATLAB 7 (R14)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 06 Oct 2006 |
John D'Errico
|
|
|
| 12 Oct 2006 |
lijo joy
|
|
|
| Updates |
| 10 Oct 2006 |
Taking John's excellent review on board, changed precedence to more usual divide before multiply. Also changed help a little. Might get around to adding brackets some day if file proves popular. |
|
Contact us at files@mathworks.com