jmp-l
[Top] [All Lists]

Re: short integer data type

To: <jmp-l@lists.biostat.wustl.edu>
Subject: Re: short integer data type
From: <Gunter.Hartel@csl.com.au>
Date: Mon, 24 Apr 2006 11:14:38 +1000
Thread-index: AcZk7OhHGPgy3+2TRfKZIAgCBDo8ZgCTUeMw
Thread-topic: [jmp-l] short integer data type
In version 6 under Column Info you now have additional choices. Instead
of just Numeric, Character and Row-state, you also get 1-byte integer,
2-byte integer, and 4-byte integer.  

Numeric data are typically stored in a floating point format that takes
up 4 or 8 bytes of storage (if I recall the # of bytes correctly here?).
If you have a column that only contains integers then you can save some
space and processing time by storing the data in an integer format.  A
1-byte integer can take values up to (2^8)-1 or 0 to 255 (or 2^7 to
leave one bit for the sign).  That's perfect for storing category
indices (i.e. use value labels rather than spell out the whole thing).
Similarly 2-byte and 4-byte integers can store integers up to (2^16)-1 =
65535 or (2^32)-1 = 4,294,967,295, a bit over 4 billion.  In the olden
days when a main-frame might have 48kb of RAM that mattered a lot and we
were very clever about saving bits here and there.  With multi-gigabytes
of RAM it seems less important.  Until you work with really big data
sets as you might get for imaging or scanning type machines.  The using
1 or 2 bytes 10 million times makes a difference from using 8 or 16
bytes.  Also integers have the nice property that they are exactly what
they say they are.  With floating point numbers often 100 is really
99.99999 and if you say if(x >= 100, ... you might find that 100 doesn't
meet that condition and you can get different results than you might
expect.
Cheers
Gunter


-----Original Message-----
From: jmp-l-owner@lists.biostat.wustl.edu
[mailto:jmp-l-owner@lists.biostat.wustl.edu] On Behalf Of
roncross@cox.net
Sent: Friday, 21 April 2006 12:40 PM
To: jmp-l@lists.biostat.wustl.edu; jmp-l@lists.biostat.wustl.edu
Subject: Re: [jmp-l] short integer data type

What is a short integer?
> 
> From: <Gunter.Hartel@csl.com.au>
> Date: 2006/04/20 Thu PM 09:38:58 EDT
> To: <jmp-l@lists.biostat.wustl.edu>
> Subject: [jmp-l] short integer data type
> 
> Hi all,
> 
> Is it possible to set a column's data type to short integer from a
> script?
> 
> Thanks
> 
> Gunter
> 
>  
> 
> 
> 


<Prev in Thread] Current Thread [Next in Thread>