Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is there a simple way to use Integer types (in particular, a table of Integer types) that require only 4 or 8 bytes (reps. 32 and 64 bits) representation?

It seems that integers in Mathematica have a 192 bits representation:

ByteCount[RandomInteger[]]
24

Using a 64 bits representation would save up lots of memory in problems where you know you don't require too large integers and memory is an issue.

Note that this question applies to other types.

share|improve this question
    
fyi, I get 16 on windows 7, 64 bit, version 9.01 !Mathematica graphics –  Nasser Jun 27 at 0:39
    
really !?, I use Mathematica 8.0.4.0 on MacOSX x86 –  VanillaSpinIce Jun 27 at 0:45
4  
You might want to look at packed arrays: mathematica.stackexchange.com/questions/3496/… –  acl Jun 27 at 1:24
    
I also get 16 on running V9.0.1 on OS X –  m_goldberg Jun 27 at 6:06
    
I get 16 on V9.0.1 on Windows 8.1 (x64, of course). –  m0nhawk Jun 27 at 6:15

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.