Connecting Tech Pros Worldwide Forums | Help | Site Map

32 bit unsigned integer field?

Peter Piper
Guest
 
Posts: n/a
#1: Nov 13 '05
A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.
Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: 32 bit unsigned integer field?


No.

Would 4 byte fields do?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Piper" <NoEmail@Email.com> wrote in message
news:cmvjl7$jpc$1@sparta.btinternet.com...[color=blue]
>A Quick question if someone could help, im sure this has been asked before,
>but googling is getting me now where slowly.
>
> Is it possible to get an unsigned 32 bit integer field in Access.
>
> Im storing IP address in their integer form (ie. 32 bits) and Long Integer
> because it is signed can not represent the full range needed
> (0..4294967295), neither can Double.
>
> Any suggestions please?
>
> Cheers PeteP.
>
> PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.[/color]


Lyle Fairfield
Guest
 
Posts: n/a
#3: Nov 13 '05

re: 32 bit unsigned integer field?


Peter Piper <NoEmail@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:
[color=blue]
> A Quick question if someone could help, im sure this has been asked
> before, but googling is getting me now where slowly.
>
> Is it possible to get an unsigned 32 bit integer field in Access.
>
> Im storing IP address in their integer form (ie. 32 bits) and Long
> Integer because it is signed can not represent the full range needed
> (0..4294967295), neither can Double.
>
> Any suggestions please?
>
> Cheers PeteP.
>
> PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.[/color]

posted preiously:

As we know decimals can be effected in VBA through their assignment (as a
string seems to be more efficient for long ones then as a number) with the
CDec operator.

They are stored in the 16 bytes of the variant as

byte(0) -> 14 ... the type, ie decimal
byte(1) -> 0 ... seemingly unused
byte(3) -> the number of decimal places
byte(4) -> 0 (positive) or 128 (negative)
bytes(5 - 15) a 48 bit unsigned integer ( ... not the 16 bit integer we
know and love??)

While the help file calls these signed integers they do not seem to be
signed integers in the way a long is a signed integer, that is where the
last (or first depending upon your view point) bit is set to indicate
negativity, while the other bits of that byte hold values. In fact the 48
bits are signed by the preceding byte and are in my opinion, basically
unsigned, as we use signed.

That is 2^32 -1 as a decimal (variant) is 4294967295 while the same bytes
as a long are -1 ... (not to be confused with 2^32-1 as an expression which
is stored as a double.)

Why do I mention this?

Sometimes in programming we want an unsigned integer. I think positive
decimals with zero places of decimals could give us such and I think VBA is
hiding a 48 bit mathematical capability which might prove useful in ... I'm
sure there MUST be something!

--
Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.
Steve Jorgensen
Guest
 
Posts: n/a
#4: Nov 13 '05

re: 32 bit unsigned integer field?


The Currency data type is commonly used for this purpose. It is stored as an
8-byte signed integer, decimal-shifted by 4 places. Subtract 1-bit for the
sign, and less than 14-bits for the decimal shift, and that leaves 6 bytes
plus 1 bit. Plenty of overhead left to fit in a 4-byte unsigned value without
problems.

On Thu, 11 Nov 2004 11:50:00 +0000 (UTC), Peter Piper <NoEmail@Email.com>
wrote:
[color=blue]
>A Quick question if someone could help, im sure this has been asked
>before, but googling is getting me now where slowly.
>
>Is it possible to get an unsigned 32 bit integer field in Access.
>
>Im storing IP address in their integer form (ie. 32 bits) and Long
>Integer because it is signed can not represent the full range needed
>(0..4294967295), neither can Double.
>
>Any suggestions please?
>
>Cheers PeteP.
>
>PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.[/color]

Trevor Best
Guest
 
Posts: n/a
#5: Nov 13 '05

re: 32 bit unsigned integer field?


Steve Jorgensen wrote:[color=blue]
> The Currency data type is commonly used for this purpose. It is stored as an
> 8-byte signed integer, decimal-shifted by 4 places. Subtract 1-bit for the
> sign, and less than 14-bits for the decimal shift, and that leaves 6 bytes
> plus 1 bit. Plenty of overhead left to fit in a 4-byte unsigned value without
> problems.[/color]

But you have to be careful to format it whenever it's used else you'll
always get a currency symbol plonked on the front if none is specified,
and I'm sure many will know my feeling on the silliness of that.

--
This sig left intentionally blank
Peter Piper
Guest
 
Posts: n/a
#6: Nov 13 '05

re: 32 bit unsigned integer field?


Yes 4 bytes (32 bits) would do if it was unsigned allowing the full
range of +ve numbers possible with 4 bytes.

Allen Browne wrote:
[color=blue]
> No.
>
> Would 4 byte fields do?
>[/color]
Peter Piper
Guest
 
Posts: n/a
#7: Nov 13 '05

re: 32 bit unsigned integer field?


Im not sure what this means, im a delphi programmer.
When i create the fields i want to be able to select Number as the field
type then which ever Number is 32 bits (unisned) however there does'nt
appear to be one?

Lyle Fairfield wrote:
[color=blue]
> Peter Piper <NoEmail@Email.com> wrote in news:cmvjl7$jpc$1
> @sparta.btinternet.com:
>
>[color=green]
>>A Quick question if someone could help, im sure this has been asked
>>before, but googling is getting me now where slowly.
>>
>>Is it possible to get an unsigned 32 bit integer field in Access.
>>
>>Im storing IP address in their integer form (ie. 32 bits) and Long
>>Integer because it is signed can not represent the full range needed
>>(0..4294967295), neither can Double.
>>
>>Any suggestions please?
>>
>>Cheers PeteP.
>>
>>PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.[/color]
>
>
> posted preiously:
>
> As we know decimals can be effected in VBA through their assignment (as a
> string seems to be more efficient for long ones then as a number) with the
> CDec operator.
>
> They are stored in the 16 bytes of the variant as
>
> byte(0) -> 14 ... the type, ie decimal
> byte(1) -> 0 ... seemingly unused
> byte(3) -> the number of decimal places
> byte(4) -> 0 (positive) or 128 (negative)
> bytes(5 - 15) a 48 bit unsigned integer ( ... not the 16 bit integer we
> know and love??)
>
> While the help file calls these signed integers they do not seem to be
> signed integers in the way a long is a signed integer, that is where the
> last (or first depending upon your view point) bit is set to indicate
> negativity, while the other bits of that byte hold values. In fact the 48
> bits are signed by the preceding byte and are in my opinion, basically
> unsigned, as we use signed.
>
> That is 2^32 -1 as a decimal (variant) is 4294967295 while the same bytes
> as a long are -1 ... (not to be confused with 2^32-1 as an expression which
> is stored as a double.)
>
> Why do I mention this?
>
> Sometimes in programming we want an unsigned integer. I think positive
> decimals with zero places of decimals could give us such and I think VBA is
> hiding a 48 bit mathematical capability which might prove useful in ... I'm
> sure there MUST be something!
>[/color]
Allen Browne
Guest
 
Posts: n/a
#8: Nov 13 '05

re: 32 bit unsigned integer field?


If you create a Number field in an Access table, and set its Size to Byte,
you have no choice. Access only gives you the unsigned byte.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Piper" <NoEmail@Email.com> wrote in message
news:cn25fd$eaq$5@titan.btinternet.com...[color=blue]
> Yes 4 bytes (32 bits) would do if it was unsigned allowing the full range
> of +ve numbers possible with 4 bytes.
>
> Allen Browne wrote:
>[color=green]
>> No.
>>
>> Would 4 byte fields do?
>>[/color][/color]


Gregory Paret
Guest
 
Posts: n/a
#9: Nov 13 '05

re: 32 bit unsigned integer field?


Peter Piper wrote:[color=blue]
> Is it possible to get an unsigned 32 bit integer field in Access.
>
> Im storing IP address in their integer form (ie. 32 bits) and Long
> Integer because it is signed can not represent the full range needed
> (0..4294967295), neither can Double.[/color]

No, there is no 32-bit unsigned field type, but the Decimal type stores 48 bit
signed numbers and the Double type has a 52-bit mantissa, both of which can
accurately hold your 32-bit unsigned numbers.

-Greg.
Gregory Paret
Guest
 
Posts: n/a
#10: Nov 13 '05

re: 32 bit unsigned integer field?


Gregory Paret wrote:[color=blue]
> No, there is no 32-bit unsigned field type, but the Decimal type stores
> 48 bit signed numbers and the Double type has a 52-bit mantissa, both of
> which can accurately hold your 32-bit unsigned numbers.[/color]

Correcting myself, the Decimal type stores 96 bit signed numbers.

-Greg.
John Winterbottom
Guest
 
Posts: n/a
#11: Nov 13 '05

re: 32 bit unsigned integer field?


"Peter Piper" <NoEmail@Email.com> wrote in message
news:cmvjl7$jpc$1@sparta.btinternet.com...[color=blue]
>A Quick question if someone could help, im sure this has been asked before,
>but googling is getting me now where slowly.
>
> Is it possible to get an unsigned 32 bit integer field in Access.
>
> Im storing IP address in their integer form (ie. 32 bits) and Long Integer
> because it is signed can not represent the full range needed
> (0..4294967295), neither can Double.
>
> Any suggestions please?
>[/color]


I would store each octet in it's own column with data type Tinyint.


Closed Thread