473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

32 bit unsigned integer field?

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.
Nov 13 '05 #1
10 11090
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" <No*****@Email.com> wrote in message
news:cm**********@sparta.btinternet.com...
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.

Nov 13 '05 #2
Peter Piper <No*****@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:
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.


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.
Nov 13 '05 #3
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 <No*****@Email.com>
wrote:
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.


Nov 13 '05 #4
Steve Jorgensen wrote:
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.


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
Nov 13 '05 #5
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:
No.

Would 4 byte fields do?

Nov 13 '05 #6
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:
Peter Piper <No*****@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:

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.

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!

Nov 13 '05 #7
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" <No*****@Email.com> wrote in message
news:cn**********@titan.btinternet.com...
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:
No.

Would 4 byte fields do?

Nov 13 '05 #8
Peter Piper wrote:
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.


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.
Nov 13 '05 #9
Gregory Paret wrote:
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.


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

-Greg.
Nov 13 '05 #10
"Peter Piper" <No*****@Email.com> wrote in message
news:cm**********@sparta.btinternet.com...
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?

I would store each octet in it's own column with data type Tinyint.
Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Andy | last post by:
Hi, Are 1 through 4 defined behaviors in C? unsigned short i; unsigned long li; /* 32-bit wide */ 1. i = 65535 + 3; 2. i = 1 - 3; 3. li = (unsigned long)0xFFFFFFFF + 3; 4. li = 1...
12
by: Peter Ammon | last post by:
When I add an unsigned long long and an int, what type do each of the values get promoted to before the addition is performed? What is the type of the resulting expression? What occurs if the...
2
by: Laszlo Szijarto | last post by:
Using reflection, I am iterating through an array of FieldInfo objects and wish to determine whether any given field represents a signed or an unsigned variable (makes a difference in terms of how...
9
by: luke | last post by:
Hi everybody, please, can someone explain me this behaviour. I have the following piece of code: long long ll; unsigned int i = 2; ll = -1 * i; printf("%lld\n", ll);
4
by: techie | last post by:
I have defined a number of unsigned integer types as follows: typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; typedfe long long uint64; Is it...
3
by: wenmang | last post by:
Hi, I encountered a problem involving storage of unsigned long long. The requirement of incoming data field is an unsigned 64-bit integer, but on our system, due to lack of support of 64-bit...
24
by: Paulo Matos | last post by:
Hello, Is it safe to assume a size_t is an unsigned long? (is it forced by the standard?) Thank you, Paulo Matos
7
by: somenath | last post by:
Hi All, I am trying to undestand "Type Conversions" from K&R book.I am not able to understand the bellow mentioned text "Conversion rules are more complicated when unsigned operands are...
28
by: Fore | last post by:
Hello I am looking for some effecient way to convert a 32 bit unsigned integer to a 16 bit signed integer. All I want is the lower 16 bits of the 32 bit unsigned integer , with bit 15 (0..15) to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.