I need a decent calculator for working in Hex

Xenesis

macrumors regular
Original poster
Sep 3, 2006
197
0
Australia
One of my hobbies involves fiddling around with Hex editors. Now while just dabbling around is okay, I often find myself needing to convert numbers to Decimal to get my head around them.

That being said, the OSX Calculator can do that right? Yep. But it's endlessly frustrating, because OSX Calculator doesn't allow one to type directly into hex (Eg, I wanna Write 0x0A, I have to type 10 in Dec). While this is fine for simple numbers, when I want to translate 048A3D to Dec, it's an exercise in frustration. Not to mention the amount of menu clicking to convert from Dec to Hex.

I guess what I'm looking for is something that works in a way similar to how Windows Calculator handles Hex (Can type numbers directly into hex, one click numbering system conversion).

Anyone got any good programs they use?
 

Xenesis

macrumors regular
Original poster
Sep 3, 2006
197
0
Australia
Hmm...I suppose I should have said this earlier..I'm using Panther (10.3), and hence I can't use Widgets.
 

telecomm

macrumors 65816
Nov 30, 2003
1,372
8
Rome
It's shareware (and I suspect there's freeware somewhere that'll do what you need), but PCalc might have this functionality.

Edit: You might have a look at this too (it's freeware, but I don't know if it even supports other notations).
 

officerdick

macrumors regular
May 4, 2006
136
0
i can type HEX direclty into the bundeled calculator. its a decent tool for HEX, just press Clover+3 and you gat a programmer calculator. (works in tiger donnt know if its the same in panther)
 

officerdick

macrumors regular
May 4, 2006
136
0
just found this dont know if its any help

Hidden capabilities in the Panther Calculator

Norman Palardy

Navigate to where the Calculator is installed (likely the Applications folder.)
Control click the application and select "Show Package Contents."
Navigate to Contents/Resources in the Calculator Contents. In this folder you will find:
ExpressionSheet.calcview
Graphing-2D.calcview
Hexadecimal.calcview
Move these to the Contents/Plugins folder
Start the calculator and behold; 2d graphing, an expression worksheet mode, and a hexadecimal calculator with boolean operations
 

telecomm

macrumors 65816
Nov 30, 2003
1,372
8
Rome
Xenesis said:
That's no good. It requires tiger. :confused:
So try an older version of PCalc (2.2.2), which runs on any OS beyond OS 8, and has exactly the functionality you need. Is it really that hard to figure out, it took me like 20 seconds? :rolleyes:
 

Magnus Reftel

macrumors member
May 16, 2006
77
0
Python

When I need to work with hex (or actually doing any maths at all), I fire up the Python interactive shell. Just start a terminal and type
python
Any Python expression you enter there will be evaluated and displayed. Since integers are displayed in decimal, you can convert from hex to decimal by just writing your number in hex notation like so:
0x1fff
To convert the other way around, I usually use the string formatting operator like so:
"%x" % (123)
This works for all kinds of expressions, so you can do things like
0xa000 + 100
to get a decimal offset from a hex base in decimal or
"%x" % (0xa000 + 100)
to get it in hex.
 

Pasquinel

macrumors newbie
Jan 4, 2018
1
0
Python

Hi,

thnx for this more then useful tip.
I tried it right away into Terminal.
Very helpful when it comes to modify Vendor/Product ID's in the 'info.plist' files while Hackintoshing.

Thank You so much.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.