Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use Octave as a programmer's calculator. I want to input a 64-bit pointer, but when I do apparently the 64-bit value gets silently truncated to 32-bit:

octave:44> base_ptr=0x1010101020202020
base_ptr =  538976288
octave:45> uint64(base_ptr)
ans = 538976288
octave:46> printf("%lx\n", base_ptr)

So it seems like it's truncated the input value to the low 32-bits. I would use scanf, but the docs say it should only be used internally.

How can I input the full 64-bit value?

Alternately, is there some awesome free programmer's calculator out there for Windows? (I know Windows calculator has a programmer's mode but I would like arbitrary variable support). I tried using my ti-89 but it also doesn't support 64-bit hex.

share|improve this question
Depends on exactly what you're looking for in a "programmer's calculator", but python works fine for me on arbitrarily large values. The stock Windows 7 calculator isn't all that bad either. – jjlin Sep 12 '12 at 3:14
So, I like your suggestion a lot better - it 'just works', apparently, even beyond 64-bit values. – Chris Ashton Sep 13 '12 at 16:28
Also, I did figure out how to do this in Octave, but its a pain - you have to do hex2dec("0xa0a0b0b0c0c0d0d0") or whatever value you want - for whatever reason this can read in the string correctly. – Chris Ashton Sep 13 '12 at 16:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.