473,796 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11161
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.btint ernet.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.btinter net.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.btinter net.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..429496729 5), 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.btinte rnet.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

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

Similar topics

34
16693
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 - 3;
12
5457
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 addition overflows or underflows? Thanks, -Peter
2
2075
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 I parse some data from a raw byte stream). Is there anyway to determine whether a particular field is signed or unsigned either from a FieldInfo object or else from a Type object stored in fieldInfo.FieldType property? Thank you very much...
9
3953
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
15357
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 necessary to explicitly cast from one type of unsigned integer type to another even though they do so implicitly?
3
4075
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 integer from Oralce pro-C(it only supports 32-bit integer). We have to find a way to get around it. I am wondering whether there is other way to store big int in kind of 8-byte raw data and later convert it to 64-bit integer. Is the raw data has to...
24
10461
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
5049
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 involved. The problem is that comparisons between signed and unsigned values are machine- dependent, because they depend on the sizes of the various integer types. For example, suppose that int is 16 bits
28
19443
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 used as the sign bit for the 16 bit signed integer. Any ideas/help greatly appreciated. Thanks.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.